All were really helpful thanks a lot. Now I'm interested in identifying a
particular index after being able to print out each word. Printing each word
to the console I have :
['METEOSAT-7']
['1', '24932U', '97049B', '15319.57839525', '.0058', '0-0', '0+0',
'0', '9994']
['2', '249
On 11/26/2015 12:34 PM, vincentype...@gmail.com wrote:
Hey, I'm wondering how to read individual strings in a text file. I can read a
text file by lines with .readlines() ,
but I need to read specifically by strings, not including spaces. Thanks in
advance
Read the lines with readlines(), a
>
> Hey, I'm wondering how to read individual strings in a text file. I can
> read a text file by lines with .readlines() ,
> but I need to read specifically by strings, not including spaces. Thanks
> in advance
>
How about:
for a_string in open("/path/to/file").read().split():
print(a_stri
On Thu, 26 Nov 2015 12:34:36 -0800, vincentypedro wrote:
> Hey, I'm wondering how to read individual strings in a text file. I can
> read a text file by lines with .readlines() ,
> but I need to read specifically by strings, not including spaces.
> Thanks in advance
How do you define a string?
Hey, I'm wondering how to read individual strings in a text file. I can read a
text file by lines with .readlines() ,
but I need to read specifically by strings, not including spaces. Thanks in
advance
--
https://mail.python.org/mailman/listinfo/python-list
you should have that file i/o in some try: except: pairs for starters.
and you should close data_file when you are done. isn't it just
data_file.read() ?
--
http://mail.python.org/mailman/listinfo/python-list
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.Irrad