I'm running XP SP3. The program now works great from either of the directories, as long as include 'python' before it. As far as looking at the error with stack trace, I really don't know enough yet to know how to do that. I'm running the file from command line, because I'm not sure how to run it referencing other files from idle. Lot to learn.....<br>
<br>Once again, thanks a ton for all of the help.<br><br>Matt<br><br><div class="gmail_quote">On Wed, Jul 8, 2009 at 2:35 AM, Dave Angel <span dir="ltr"><<a href="mailto:davea@ieee.org">davea@ieee.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Gabriel Genellina wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="moz-text-flowed" style="font-family: -moz-fixed">En Tue, 07 Jul 2009 09:55:13 -0300, Dave Angel <<a href="mailto:davea@ieee.org" target="_blank">davea@ieee.org</a>> escribió:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Gabriel Genellina wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
En Mon, 06 Jul 2009 19:56:40 -0300, matt0177 <<a href="mailto:matt0177@gmail.com" target="_blank">matt0177@gmail.com</a>> escribió:<br>
</blockquote></blockquote>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
When I try to run the command as outlined in<br>
the book "simple_markup2.py < test_input.txt > test_output.html i get the<br>
following error every time.<br>
<br>
IOError: [Errno 9] Bad file descriptor<br>
</blockquote>
<br>
That's a Windows problem. When you execute the script as itself (either as you do in the command line, or by double-clicking on it), it doesn't have valid standard handles.<br>
You have to invoke Python explicitely:<br>
<br>
python simple_markup2.py < test_input.txt > test_output.html<br>
<br>
(you may need to specify the full path to python.exe, or add the directory where Python is installed to your system PATH).<br>
<br>
</blockquote>
I use stdout this way all the time, with no problem (python 2.6, Windows XP). But as you point out, stdin redirection doesn't seem to work using the file associations. I do get a different error though. When I look at sys.stdin, it shows an open file, with handle of zero, as expected. But when I do a raw_input(), it gets:<br>
EOFError: EOF when reading a line<br>
</blockquote>
<br>
I think the error depends on the specific OS version/service pack. But at least on XP this appears to fix it:<br>
<br>
<a href="http://support.microsoft.com/kb/321788/en-us" target="_blank">http://support.microsoft.com/kb/321788/en-us</a><br>
<br>
</blockquote>
Thanks for the link. Looking at that one, it indicates that Windows 2000 fixed it in SP4, and XP fixed it in Sp1. But I'm already running XP SP3, so I wonder if it's something new.<br>
<br>
Matt, what OS version are you running, and exactly what is happening when the error occurs? (you should be able to figure that out from the stack trace)<br>
<br>
<br>
DaveA<br>
</blockquote></div><br>