reading from a txt file
From: jrlen balane (nbbalane_at_gmail.com)
Date: 03/30/05
- Next message: Greg Ewing: "Re: Python for a 10-14 years old?"
- Previous message: Joal Heagney: "Re: Python for a 10-14 years old?"
- Next in thread: MyHaz: "Re: reading from a txt file"
- Reply: MyHaz: "Re: reading from a txt file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 29 Mar 2005 19:36:58 -0800 To: Python List <python-list@python.org>
how should i modify this data reader:
(assumes that there is only one entry per line followed by '\n')
data_file = open(os.path.normpath(self.TextFile.GetValue()), 'r')
data = data_file.readlines()
self.irradianceStrings = map(str, data)
self.irradianceIntegers = map(int, data)
self.IrradianceExecute.SetValue(''.join(self.irradianceStrings))
so that i can read the text file created by this:
self.filename = "%s\%s.txt"
%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime("%Y%m%d%H%M"))
self.table_file = open(self.filename,"a")
self.table_file.write('%f\t'%self.temp11)
self.table_file.write('%f\t'%self.temp22)
self.table_file.write('%f\t'%self.pyra11)
self.table_file.write('%f\t'%self.pyra22)
self.table_file.write('%f\t'%self.voltage11)
self.table_file.write('%f\t'%self.current11)
self.table_file.write('\n')
self.table_file.close()
- Next message: Greg Ewing: "Re: Python for a 10-14 years old?"
- Previous message: Joal Heagney: "Re: Python for a 10-14 years old?"
- Next in thread: MyHaz: "Re: reading from a txt file"
- Reply: MyHaz: "Re: reading from a txt file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]