473,789 Members | 2,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Basic python help

I have the following simple html file that is trying to send data to a
python script, however, I am getting a weird server error:

This is my HTML:

<html>
<FORM METHOD="POST" ACTION="../cgi-bin/quoteprice2.py" >
Ticker 1
<input type="text" name="ticker1" size=10>
<br>

<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</html>
This is my Python:

#!/usr/bin/python

import cgi
print "Content-type: text/html"
print

form = cgi.FieldStorag e()
print form.keys()

print "<br>"

for x in form.keys():
print "%s=%s" % (x, form[x].value) + "<br>"
This is my error

Internal Server Error

The server encountered an internal error or misconfiguratio n and was unable
to complete your request.

Please contact the server administrator, root@localhost and inform them of
the time the error occurred, and anything you might have done that may have
caused the error.

More information about this error may be available in the server error log.

Any suggestions? Much thanks.

Mar 14 '06 #1
3 1182
Kevin Feng schrieb:
More information about this error may be available in the server error log.

Any suggestions? Much thanks.


What does the error log of the webserver say?

--
Greg
Mar 14 '06 #2
No idea, I do not have permission to access the error log.


On 3/14/06 2:12 AM, in article 29************* **************@ news.chello.at,
"Gregor Horvath" <g.*******@gmx. at> wrote:
Kevin Feng schrieb:
More information about this error may be available in the server error log.

Any suggestions? Much thanks.


What does the error log of the webserver say?

--
Greg


Mar 14 '06 #3
(Please don't top-post -- fixed)

Kevin Feng wrote:


On 3/14/06 2:12 AM, in article 29************* **************@ news.chello.at,
"Gregor Horvath" <g.*******@gmx. at> wrote:

Kevin Feng schrieb:

More information about this error may be available in the server error log.

Any suggestions? Much thanks.

What does the error log of the webserver say?

--
Greg

No idea, I do not have permission to access the error log.


In your cgi script, try putting "import cgitb; cgitb.enable()"
on the next line right after "import cgi".

Also try changing your POST to GET.

---John
--
(remove zeez if demunging email address)
Mar 14 '06 #4

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

Similar topics

3
3502
by: Dan Stromberg | last post by:
If I wanted to write a python script that performs basic auth, gets a cookie, and then does an http POST using the cookie for authentication, what would be the best python API to write to? Does someone already have example code that does something like this? Thanks.
7
9290
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. # No warranty express or implied for the accuracy, fitness to purpose
5
3002
by: Aaron Ginn | last post by:
I'm investigating the feasibility of using Python instead of Visual Basic for a commercial software package that I'm planning on developing. Now I'm absolutely a Python zealot. I use it for most of my software development at work where I work in a Solaris environment. To me, Python is the perfect language for most applications in a UNIX environment where a compiled language is not required. However, I'm not so sure about Windows. The...
9
3823
by: abisofile | last post by:
hi I'm new to programming.I've try a little BASIC so I want ask since Python is also interpreted lang if it's similar to BASIC.
6
2410
by: Engineer | last post by:
I'm looking for a Python interpreter written in BASIC, preferably Visual Basic, and one written in VBA would be best of all. An alternative would be a Python-2-Basic compiler. Unfortunately I have to develop some special purpose code in an organization where my only development environment is Microsoft Office Visual Basic for Applications. The security 'droids have decided that since the MS Office Suite is a "standard" application...
1
1471
by: bruce | last post by:
hi... i have the following test python script.... i'm trying to figure out a couple of things... 1st.. how can i write the output of the "label" to an array, and then how i can select a given element of the array.. i know real basic.. 2nd.. where can i go to find methods of libxml2dom. i've been looking using google, but can't seem to find a site pointing out the underlying methods,
4
2151
by: Hoop | last post by:
Hi, I have been working in getting Boost.Python running on my PC, seems to work now. I have what I believe is somewhat of basic question here. I am starting on an application that will developed in VS2005, probably using C++/CLI. I want to be able to exchange data in between Python and C++. The user when running the C++ app will be able to call a python script, set some values, that will then be communicated to running application, it
1
17262
by: alain MONTMORY | last post by:
Hello everybody, I am a newbie to python so I hope I am at the right place to expose my problem..... :-http://www.python.org/doc/2.4.2/ext/pure-embedding.html 5.3 Pure Embedding I download the code example from http://www.python.org/doc/2.4.2/ext/run-func.txt I call the file "TestOfficiel.c" and I compile it with : gcc -g -I/usr/include/python2.3/ TestOfficiel.c -o TestOfficiel -lpython2.3 -ldl all is OK (or seems to be...).
21
1568
by: nateastle | last post by:
I have a simple assignment for school but am unsure where to go. The assignment is to read in a text file, split out the words and say which line each word appears in alphabetical order. I have the basic outline of the program done which is: def Xref(filename): try: fp = open(filename, "r") lines = fp.readlines() fp.close()
14
1852
by: MartinRinehart | last post by:
Working on parser for my language, I see that all classes (Token, Production, Statement, ...) have one thing in common. They all maintain start and stop positions in the source text. So it seems logical to have them all inherit from a base class that defines those, but this doesn't work: import tok class code: def __init__( self, start, stop ):
0
9666
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7529
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2909
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.