Skip to content

Instantly share code, notes, and snippets.

@majaha
Created May 6, 2016 19:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save majaha/48452a1183adb8c7e20df57de64731ab to your computer and use it in GitHub Desktop.
Save majaha/48452a1183adb8c7e20df57de64731ab to your computer and use it in GitHub Desktop.
#!/bin/python3
fr = open("prime.txt")
s = fr.read(2000)
s = s.replace("\n","").replace(" ","")
i = int(s)
fw = open("prime.gz","wb")
num_bytes = (i.bit_length() // 8) + 1
fw.write(i.to_bytes(length=num_bytes, byteorder='big', signed=False))
fr.close()
fw.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment