The data is stored as an array with each element being an 8-bit binary number. I know this seems like a simple question, but I've looked and can't seem to find a simple answer on how to do it anywhere.

ar=[1,2,3,255,0,1]
fi=open("a.dat","wb") # windows needs binary open 
for i in ar:
  fi.write(chr(i))
fi.close()

Look why win needs this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.