variable to be transmitted from a CGI script to a module

M-a-S NO-MAIL at hotmail.com
Thu Sep 18 14:01:20 EDT 2003


Read also the thread "How to pass parameter to a module?"
M-a-S

"jcj" <jcjouffre at bigfoot.com> wrote in message news:4568052b.0309180125.5fd4919a at posting.google.com...
> hello,
> is it possible to have something like :
>
> script.cgi
> #!/usr/local/bin/python
> # -*-python-*-
> global MY_VARIABLE
> MY_VARIABLE = "myvalue"
> import module1
> module1.my_function()
>
> module1.py
> # -*-python-*-
> global MY_VARIABLE
> if MY_VARIABLE:
>    print 'variable defined'
> else:
>    print 'variable NOT defined'
> def my_function():
>    print 'my_function'
> Jean-Claude






More information about the Python-list mailing list