Skip to content

Instantly share code, notes, and snippets.

@2minchul
Last active December 9, 2025 04:45
Show Gist options
  • Select an option

  • Save 2minchul/fa6758044229a6555de942345cfc5330 to your computer and use it in GitHub Desktop.

Select an option

Save 2minchul/fa6758044229a6555de942345cfc5330 to your computer and use it in GitHub Desktop.
import base64
import pyperclip
target_file_path = r'C:\Users\user\Desktop\project.zip'
def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i+n]
if __name__ == '__main__':
with open(target_file_path, "rb") as f:
b = f.read()
b64 = base64.b64encode(b).decode('charmap')
chunksize = 3145728
b64_chunks = list(chunks(b64, chunksize))
for idx, chunk in enumerate(b64_chunks):
print("chunk", idx+1, "/", len(b64_chunks))
pyperclip.copy(chunk)
if len(b64_chunks) == idx+1:
break
input("Press Enter too continue...")
@2minchul
Copy link
Author

2minchul commented Dec 9, 2025

pip install pyperclip --user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment