> print "Hi there, ",os.environ["USERNAME"]
Oops, sorry, I said os.getenv(), looks like
my C background showing through :-)
Alan g.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> I tried to do this:
>
> import os
> import cgitb; cgitb.enable()
> print "Content-type: text/html\n\n"
> print "Hi there, ",os.system("echo %USERNAME%")
If you ignore the environment variable bit, does
it work with a hard coded name?
If so then try using the function os.getenv() to
fetch the va
> Anyway, I got to the Using Environment Variables chapter that is in
> this page: http://www.oreilly.com/openbook/cgi/ch02_02.html.
> This is UNIX environment variables (as I understand), and I guess
they
> will not work on Windows...
They should work on both.
THere are some variables that are di
script itself...
I tried to do this:
import os
import cgitb; cgitb.enable()
print "Content-type: text/html\n\n"
print "Hi there, ",os.system("echo %USERNAME%")
But I don't get anything in the browser (500 error - Internal Server
Error) and when I run the script in IDLE I get:
Hi there, 0
I guess
> Morning Mark,
>
> Happy New Year, Merry Christmas, and a jolly Winter Solstice Season!
>
> Whenever you're talking about how to do something in Windows it REALLY
> helps when you include WHICH windows you're working with.
>
> I believe the following will allow you to manipulate windows
> envir
Mark Kels wrote:
Hello to all :-)
I'm writing a CGI script (one of my first ever CGI programs and I'm
using this tutor to learn CGI: http://www.oreilly.com/openbook/cgi/
This isn't a python tutor, but the introductions says that any
language will be good for this tutor.
Anyway, I got to the Using E
Hello to all :-)
I'm writing a CGI script (one of my first ever CGI programs and I'm
using this tutor to learn CGI: http://www.oreilly.com/openbook/cgi/
This isn't a python tutor, but the introductions says that any
language will be good for this tutor.
Anyway, I got to the Using Environment Varia