473,568 Members | 2,905 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing a String to a Python CGI Script

When one is using an HTML form via a web broswer, the user submits the form
contents and these are passed to a CGI Python script on the web server.
I need to write a client script that connects to a web site, runs a Python
CGI script on the web server AND passes a string to the CGI Python script
that the Python CGI script can store/manipulate/evalute etc....
I know how to connect to the web site and run the CGI Python script using a
client Python script with the urllib module. But how do I submit/send a
string via this client Python script to the web server on behalf of the CGI
Python script? Can someone give me a clue or a hint on how to do that? Do
I write the string to the web server? If so, how would the CGI Python
script know about it, read it, and store it?
Thanks,
DeepBleu
Jul 18 '05 #1
2 4890
I'll reword that:
A client is writing a string to the web server (IPlanet on a Sun Server)
using a java program. The client then establishes a connection with a cgi
Python program on the server. This client wants the string to be passed
into this cgi Python script on the server.
There are no name=value request pairs. How can this cgi Python script read
the string sent to the web server. The client is POSTING the string as a
REQUEST. For the Pythong cgi script I am using CGI module to handle
requests and responses. However, how do you handle this REQUEST?

"DeepBleu" <De******@DeepB leu.org> wrote in message
news:AY******** ************@tw ister.austin.rr .com...
When one is using an HTML form via a web broswer, the user submits the form contents and these are passed to a CGI Python script on the web server.
I need to write a client script that connects to a web site, runs a Python
CGI script on the web server AND passes a string to the CGI Python script
that the Python CGI script can store/manipulate/evalute etc....
I know how to connect to the web site and run the CGI Python script using a client Python script with the urllib module. But how do I submit/send a
string via this client Python script to the web server on behalf of the CGI Python script? Can someone give me a clue or a hint on how to do that? Do I write the string to the web server? If so, how would the CGI Python
script know about it, read it, and store it?
Thanks,
DeepBleu

Jul 18 '05 #2
I figured this thing out. But, really truly no one could have suggested the
use of standard I/O????
DeepBleu

"DeepBleu" <De******@DeepB leu.org> wrote in message
news:ME******** ************@tw ister.austin.rr .com...
I'll reword that:
A client is writing a string to the web server (IPlanet on a Sun Server)
using a java program. The client then establishes a connection with a cgi
Python program on the server. This client wants the string to be passed
into this cgi Python script on the server.
There are no name=value request pairs. How can this cgi Python script read the string sent to the web server. The client is POSTING the string as a
REQUEST. For the Pythong cgi script I am using CGI module to handle
requests and responses. However, how do you handle this REQUEST?

"DeepBleu" <De******@DeepB leu.org> wrote in message
news:AY******** ************@tw ister.austin.rr .com...
When one is using an HTML form via a web broswer, the user submits the form
contents and these are passed to a CGI Python script on the web server.
I need to write a client script that connects to a web site, runs a Python CGI script on the web server AND passes a string to the CGI Python script that the Python CGI script can store/manipulate/evalute etc....
I know how to connect to the web site and run the CGI Python script

using a
client Python script with the urllib module. But how do I submit/send a
string via this client Python script to the web server on behalf of the

CGI
Python script? Can someone give me a clue or a hint on how to do that?

Do
I write the string to the web server? If so, how would the CGI Python
script know about it, read it, and store it?
Thanks,
DeepBleu


Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2498
by: wonder | last post by:
Hi, How can I pass the url of the current webpage link to a python script in html? thanks sam
3
2032
by: eight02645999 | last post by:
hi if i have a string like this "ABCE-123456 ABC_DEF_Suggest(abc def ghi).txt" that needs to be passed to a python script and i wanted to get the words inside the brackets after i passed this string. I did a re something like
5
3009
by: Chris Hieronymus | last post by:
Hi, I have a bunch of x-y data contained in an array. I would like to plot the data using an external program (psxy in GMT). The plotting program takes x-y couples as standard input. How do I get the data into the system call? I used to do things in csh and awk, i.e., something like
5
9846
by: moni | last post by:
Hi.. I am trying to use javascript for google maps display. If I call the javascript function from my aspx file I use: <input type="text" id="addresstext" value="Huntington Avenue, Boston, MA" name="yourName" style="width: 287px" />
2
4424
by: luis | last post by:
I'm using ctypes to call a fortran dll from python. I have no problems passing integer and double arryas, but I have an error with str arrys. For example: ..... StringVector = c_char_p * len(id) # id is a list of strings Id_dat=StringVector() for i in range(len(Id)): ....Id_dat=id
6
2382
Megadeus
by: Megadeus | last post by:
Okay, I've been programming for awhile in many different languages, but my current obsession is Python. Whenever I get into a new language, I usually write a small program, usually in the form of a dice roller. My Python dice roller is probably the best I've done yet (rivaling my mIRC script one ^_~), and I'm thrilled that I've been able to use...
5
3304
by: goldtech | last post by:
Hi, I'm passing what I think is a string parameter to another Python program (spawn.py) - see the code snip below. But only the counter part gets printed to a log file via spawn.py. Yet the echo print to the output window shows the whole string with the fc part. Better explained below I hope, there's the calling .py and the spawn script...
2
10904
by: neeebs | last post by:
Hi, I'm not sure if this is a javascript problem per se, but here goes. I have an xsl document with a python function defined within a <script> block. Elsewhere in the xsl file, within a python script block, I call the python function and store the return value in a variable. I need to be able to display this returned value on the webpage...
6
1412
by: Rafe | last post by:
Forgive me if I mangle any terminology here, but please correct me if I do... I have an object which acts exactly like a string as long as I stay in Python land. However, I am using the object in Softimage|XSI a 3D application on Windows. It was created while (briefly) owned by Microsoft, so knowledge of COM with excel or anything else...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.