By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,767 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,767 IT Pros & Developers. It's quick & easy.

Calling python module in cgi script

P: n/a
hi,

I am pretty new to python and i came up with this problem. What i'm
trying to do is call a python module from my cgi script, which is
inovked by a html form.

First the cgi script gets a value from the form and sends it to the
python module which takes that value and processes it and sends the
result back to the cgi script which again processes it and show the
result.How do i do that? Any suggestion is greatly appreciated.

Thanks,
Wroozee

PS: I can post my code if anyone wants to see it.
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
wr*****@hotmail.com (Wroozee) writes:
[...]
First the cgi script gets a value from the form and sends it to the
python module which takes that value and processes it and sends the
result back to the cgi script which again processes it and show the
result.How do i do that? Any suggestion is greatly appreciated.

[...]

Just import your module and have at it:

#!/usr/local/bin/python -u

import cgi
....

import my_module
info = my_module.process(some_cgi_data)
There is no need for your module to run in a separate process from
your other module, hence no need for any complicated 'sending back and
forth' of data.
John
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.