Re: python scripts with IIS

2008-01-19 Thread Rolf van de Krol
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:

Re: stdin, stdout, redmon

2008-01-21 Thread Rolf van de Krol
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

Re: stdin, stdout, redmon

2008-01-21 Thread Rolf van de Krol
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

Re: stdin, stdout, redmon

2008-01-22 Thread Rolf van de Krol
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

Re: Executing other python code

2008-01-28 Thread Rolf van de Krol
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

Re: [2.4.2/Linux] Getting Python to fork?

2008-02-04 Thread Rolf van de Krol
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

Re: Write ooxml .ods (spreadsheat) from python?

2008-02-13 Thread Rolf van de Krol
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

Re: Reading a keypress

2008-02-25 Thread Rolf van de Krol
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

Re: Is this valid ?

2008-03-20 Thread Rolf van de Krol
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