>>>>> zxo102 <zxo...@gmail.com> (z) wrote:

>z> Hi everyone,
>z>     How can I pass a string generated from python cgi at server side
>z> to a
>z> javascript function as an argument at client side?

>z>  I want test.py to "return"  a "hello" back so the javascript function
>z> load takes "hello" as argument like  load("hello").

>z> 2. server side: test.py
>z> ...
>z> #!c:\python24\python.exe

>z> def main():
>z>    message = 'hello'
>z>    #return message

>z> main()
>z> ...

>z> Any ideas?

CGI scripts return stuff by printing it, or more generally writing to
stdout.

So print message should do. The rest is not a Python question but a
Javascript question.
-- 
Piet van Oostrum <p...@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to