hi everyone,
i have a script that exports an array to a file kinda like this:
[[‘NOF’, 0, 0, 0, [], [], []], [60, 1, 3, 6], [62, 9, 11, 13], [64, 13, 14, 21], [‘NOF’]]
using this bit of script:
def save(self,savefile):
global startstop
global fname
print("saving as:")
print(savefile)
try:
f = open(savefile,'w')
print ("file open")
except:
print("unable to save file.")
try:
self.writeln(f,self.startstop)
print("file saved")
print self.startstop
f.close()
print ("file closed")
except:
print("cannot save")
def writeln(self,f,x):
f.write(str(x))
f.write("
")
and it works fine, but when i try to import the array using this code:
def load(self,loadfile):
f = open(str(loadfile),'r')
self.startstop = f.readline()
but it says that the value is out of range.
any sergestions of a better way of importing and exporting the array?
thanks, levon