Re: How to tell whetehr Python script called as CGI or from command line?

2007-05-11 Thread rowan
> import os > if "QUERY_STRING" in os.environ: > # CGI script > > might work. Thanks Steve for this suggestion. I did something similar: import os req = os.getenv('REQUEST_URI') if (not req is None) and len(req) > 0: web = Tru

Re: Change serial timeout per read

2007-05-10 Thread rowan
than the non-blocking plus sleep approach. Of course I don't know whether my method will work on Linux, and there may be problems I haven't found yet. Rowan -- http://mail.python.org/mailman/listinfo/python-list

Change serial timeout per read

2007-05-09 Thread rowan
#x27;m working in Windows, but I'd prefer a platform independent solution if possible... Thanks - Rowan -- http://mail.python.org/mailman/listinfo/python-list

How to tell whetehr Python script called as CGI or from command line?

2007-04-16 Thread rowan
ill always have a value in a web request, but which will be None if running from the command line or as a Cron job, or something similar? How? Thanks - Rowan -- http://mail.python.org/mailman/listinfo/python-list