Python Error from Apress book

matt0177 matt0177 at GMAIL.COM
Mon Jul 6 18:56:40 EDT 2009


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 <module> 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.




More information about the Python-list mailing list