Heh,
Cut 'im some slack there Bob, I only just figured out that line[:1] ==
line[0]...
On 10/28/05, bob <[EMAIL PROTECTED]> wrote:
> At 01:42 PM 10/27/2005, Adam wrote:
> > >if line[:1] == "1":
> >
> >This line won't work because you're getting the first 2 characters from
> >the line
>
> Oh? Did
Oops,
filePaths = [os.path.join(direc, item) for item in os.listdir(direc)
if not os.path.isdir(os.path.join(direc, item))]
should be
> filePaths = [os.path.join(dirPath, item) for item in os.listdir(dirPath)
> if not os.path.isdir(os.path.join(dirPath, item))]
...
__
Mike Haft wrote:
> Hello all,
> I'm new to python but so far I have to say its a really good language
>
> I've been having some trouble with File IO can anyone help? I've got the
> basics but my problem is that I have many files (one for each year of the
> last 100 years or so) that look l
At 01:42 PM 10/27/2005, Adam wrote:
> >if line[:1] == "1":
>
>This line won't work because you're getting the first 2 characters from
>the line
Oh? Did you test that? When I do that I get 1 character. Why? Because
slicing goes UP TO the 2nd argument.
>>> 'abc'[:1]
'a'
>if line[:1] == "1":
This line won't work because you're getting the first 2 characters from
the line and seeing if it's equal to a string of length one. For
example in your test file if you put this line,
1 12.4 12.0 * 10 ,
through that bit of code it would see if "1 " == "1", which
At 12:18 PM 10/27/2005, Mike Haft wrote:
>Apologies for not making things clearer last time.
>
>My specific problems are:
>
>why can I not get the readline() or readlines() functions to work, I'm
>told they are not defined whenever I try.
Mike * Oh * Mike ... and all others ...
Please Post The Co
On Thu, 27 Oct 2005, Mike Haft wrote:
> why can I not get the readline() or readlines() functions to work, I'm
> told they are not defined whenever I try.
Don't paraphrase. *grin*
Show us what you did in terms of the code that you ran. Also, include the
literal error message and its tracebac