Python Error from Apress book

2009-07-06 Thread matt0177

http://www.nabble.com/file/p24364269/simple_markup2.py simple_markup2.py 
http://www.nabble.com/file/p24364269/util2.py util2.py 

The two above files are from chapter 20 of the Apress book "Beginning Python
>From Novice to Professional". When I try to run the command as outlined in
the book "simple_markup2.py < test_input.txt > test_output.html i get the
following error every time.

File "C:\Python25\Scripts\simple_markup2.py", line 7, in  for block
in blocks(sys.stdin):
File "C:\Python25\Scripts\util2.py", line 7, in blocks for line in
lines(file):
File "C:\Python25\Scripts\util2.py", line 2, in lines for line in file:
yield line
IOError: [Errno 9] Bad file descriptor

I've tried this code on two different computers (both winxp, python 2.5.1)
with the same results. when simple_markup2.py is run with only output, it
will correctly write the headers. When you try to add an input file, you get
the error every time, and I have tried every text file known to man,
including the downloadable sample. This has been frustrating me for several
days, any advice would be greatly appreciated. I'm just starting to learn
python so troubleshooting is a sorely lacked skill atm :)

Thanks,

Matt


-- 
View this message in context: 
http://www.nabble.com/Python-Error-from-Apress-book-tp24364269p24364269.html
Sent from the Python - python-list mailing list archive at Nabble.com.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Error from Apress book

2009-07-07 Thread matt0177

Adding the python before the command line didn't work at first, but upon
moving the files to the c:\python25 it worked like a champ. Thank you both
for the help. Very frustrating to run into stuff like this when you're first
trying to learn a knew language, it really throws off your momentum!
-- 
View this message in context: 
http://www.nabble.com/Python-Error-from-Apress-book-tp24364269p24374988.html
Sent from the Python - python-list mailing list archive at Nabble.com.

-- 
http://mail.python.org/mailman/listinfo/python-list