I read data file by this code:
f = open ('a-small.in.txt', 'r+')
('a-small.in.txt' file must be at the same directory, where your
python is)
c = f.readline()
(now c contains data as string from first line)
if I want read different numbers from one line I do this:
c = f.readline()
c = c.split()
(after this c contains data as array of string. First number at line
is in c[0], second in c[1] and so on)
at the end:
f.close()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-codejam" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-code?hl=en
-~----------~----~----~----~------~----~------~--~---