Re: Python Questions
Use can use the pickle module to pack and unpack lists, dictionaries, and other data for writing to a text document. Example:
import pickle
#write data
def write(data,name):
tmp = open(name,'w')
pack = pickle.dumps(data)
tmp.write(pack)
tmp.close()
#read data def read(name): tmp = open(name,'r') pack = tmp.read() data = "" tmp.close() return data shopping = ['green eggs',1234,'ham',5678] write(shopping,'test.txt') tmp = read('test.txt') print tmp
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector