Skip to content

Instantly share code, notes, and snippets.

@ourway
Created December 29, 2013 21:20
Show Gist options
  • Save ourway/8174957 to your computer and use it in GitHub Desktop.
Save ourway/8174957 to your computer and use it in GitHub Desktop.
import array
def convert_to_binary(path):
f = open(path, 'r')
o = open('%s.bin'%path, 'wa')
for line in f.readlines():
x,y = line.split(',')
data = array.array('i', [int(x),int(y)])
data.tofile(o)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment