Re: [Tutor] string from input file

2008-04-29 Thread Alan Gauld
"Bryan Fodness" <[EMAIL PROTECTED]> wrote f = open(infile, 'r') s = f.readlines() f.close() This just reads the lines as text from the file. It includes any whitespace and linefeeds in the file. Block = str(s[1]) Since its text you don;t need the str() but you probably shoul

Re: [Tutor] string from input file

2008-04-29 Thread Sander Sweers
On Tue, Apr 29, 2008 at 11:54 PM, Bryan Fodness <[EMAIL PROTECTED]> wrote: > I am trying to get values from an input file, > > 0.192 > Custom > 15 > IN > > but, when I check to see if they are equal it is not true. > > f = open(infile, 'r') > s = f.readlines() > f

Re: [Tutor] string from input file

2008-04-29 Thread Hansen, Mike
> -Original Message- > On > Behalf Of Bryan Fodness > Sent: Tuesday, April 29, 2008 3:54 PM > To: tutorpythonmailinglist Python > Subject: [Tutor] string from input file > > I am trying to get values from an input file, > > 0.192 > Cus

[Tutor] string from input file

2008-04-29 Thread Bryan Fodness
I am trying to get values from an input file, 0.192 Custom 15 IN but, when I check to see if they are equal it is not true. f = open(infile, 'r') s = f.readlines() f.close() Block = str(s[1]) Angle = float(s[2]) Position = str(s[3]) if Bloc