473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Retrieve input

A little while ago, someone told me that for the BaseHTTPServer module,
the whole request would be stored in self.rfile.
I looked at the doumentation and is says rfile is:
"Contains an input stream, positioned at the start of the optional
input data."
How do i get the input out of it?

Dec 1 '05 #1
3 1435
"amfr" wrote:
A little while ago, someone told me that for the BaseHTTPServer module,
the whole request would be stored in self.rfile.
I looked at the doumentation and is says rfile is:
"Contains an input stream, positioned at the start of the optional
input data."
How do i get the input out of it?


by reading from it, as you would read data from any other file:

http://docs.python.org/lib/bltin-file-objects.html

(the word "stream" usually refers to a file or file-like object. seeking
is usually not supported, and file-like objects may not implement all
the methods available on a "real" file object. the basics should work,
though: read, readline, etc.)

</F>

Dec 1 '05 #2
Thanks, but when I try to read the stream using read(), the script just
keeps on going and does not stop. When i press ctrl + c, the script
shows thsi (top of error taken off):
File "modules/runpython.py", line 88, in runModule
sys.stdin = self.rfile.read()
File
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/socket.py",
line 283, in read
data = self._sock.recv(recv_size)
KeyboardInterrupt

Any ideas?

Dec 1 '05 #3
amfr wrote:
Thanks, but when I try to read the stream using read(), the script just
keeps on going and does not stop. When i press ctrl + c, the script
shows thsi (top of error taken off):
File "modules/runpython.py", line 88, in runModule
sys.stdin = self.rfile.read()
File
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/socket.py",
line 283, in read
data = self._sock.recv(recv_size)
KeyboardInterrupt

Any ideas?


It's connecting to a server, and trying to grab all the data... but the
server isn't sending anything at this point, so the call to _sock.recv()
blocks indefinitely.

Troubleshooting further would require details you haven't provided, such
as what URL is requested, what the server is, etc...

-Peter

Dec 1 '05 #4

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

Similar topics

2
by: Frank | last post by:
Can I do this? I add a session var in C# and ultimatly want to pass it into a vbscript client side activeX control. This is what I have so far but get " Object Required:'name2' " error. Can...
3
by: niftyhawk | last post by:
Hi All, I have a php page say "abc.php" generating the following HTML. I am posting the form action to another php page say "TestCheckbox.php". How do I retrieve in "TestCheckbox.php" which...
1
by: glady | last post by:
Hi, I would like to have a php form that gets input from user and display data if they have already entered for that particular record in the same form. For example, if i have a form with 20...
6
by: ashok.dhananjeyan | last post by:
Hi, Actually , I wrote one javascript to retrieve the name of the form in one particular page. what i did in this page is, <script> function checkbutton() {
3
by: bazubwabo | last post by:
hi everybody , could u please help me to find out the error on my asp codes,i can't retrieve the inserted values. Here is below the code: <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!DOCTYPE...
4
by: kang jia | last post by:
hi i am doing mailinglist currently. the code in my first page is like this : : <html> <head> <link rel="stylesheet" type="text/css" href="gallery.css" /> <script language="JavaScript"> ...
2
by: Danielle | last post by:
Hello all, I'm pretty new to asp.net, I've to do a quick port to ASP.net I've got a problem I cannot solve: cannot find anything helpfull on the web. I've got an HTML form generated from a...
3
by: David | last post by:
Hi, I have some code in my form as follows, to display 1 to 20 additional sets of fields to enter guest information. I am not sure how to retrieve these guests info so that I can post the info...
21
by: giandeo | last post by:
Hello Experts. Is it possible to retrieve the value from a populated pull down menu from a database and then use that value to access the same database to get the related fields. Example: ...
2
by: phpachu | last post by:
Hi, I hav created a group of textboxes using a loop and its names are unique and names are assigned using variable ( like <input type=text name=$name1>). Then How can i retrieve the values in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.