Adding the following lines before your print statement should do the
trick. IIS complains about the headers, so adding headers should help.
print "Content-Type: text/html" # HTML is following
print # blank line, end of headers
william paul wrote:
>
> Hello:
According to various tutorials this should work.
|import sys
data = sys.stdin.readlines()
print "Counted", len(data), "lines."|
Please use google before asking such questions. This was found with only
one search for the terms 'python read stdin'
Rolf
Bernard Desnoues wrote:
> Hi,
>
> I've go
e2']
Just plain simple and just works.
Rolf
Bernard Desnoues wrote:
> Rolf van de Krol a écrit :
>
>> According to various tutorials this should work.
>>
>>
>> |import sys
>> data = sys.stdin.readlines()
>> print "Counted", len(data
Well, that's at least weird. I did test my code with Python 2.5 on Win
XP, using the command prompt. But testing it with IDLE gives exactly the
same error Bernard has. So apparently STDIN can't be accessed with IDLE.
Rolf
John Machin wrote:
>
> Excuse me, gentlemen, may I be your referee *befor
AFAIK this can't be done with just python. You can use the C API of
Python to achieve this. I don't know the details of that, but I guess
you will need this (http://docs.python.org/api/api.html).
Rolf
Tim Rau wrote:
> I'm working on a game, and I'd like players to be able to define thier
> ship
To create a deamon, you indeed need to fork two times. For more
information and a working example see:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 . I'm
quite sure this works, because I used it several times to create a deamon.
Jon Ribbens wrote:
> On 2008-02-04, Christian H
Neal Becker wrote:
> I'd like to output some data directly in .ods format. This format appears
> to be quite complex. Is there any python software available to do this? I
> did look at pyuno briefly. It looks pretty complicated also, and it looks
> like it uses it's own private version of pytho
wyleu wrote:
> Aaah it doesn't work from idle but it does from the command line...
>
>
You are right. You can't read STDIN from IDLE. There has been a topic
about that before:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/9f9c90cfe52378fe
--
http://mail.python.org/mail
John Machin wrote:
> Of course. You can chain comparisons as much as you like and is
> (semi-)sensible, e.g.
>
Hmm, 'of course' is not the correct word for it. Although the Stef
Mientki would probably be able to find it in the documentation it is not
as simple as you might think.
Most language