473,492 Members | 4,301 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to run python scripts on a website

py
i have a website which runs apache on linux. it supports python (i
think via cgi....not sure how else). anyway how can I go to a web page
and run a python script or something like that? for example say i make
a script which prints out all the links on another URL....how can i run
that?
thanks!

Jan 22 '06 #1
2 4392
py wrote:
i have a website which runs apache on linux. it supports python (i
think via cgi....not sure how else). anyway how can I go to a web page
and run a python script or something like that? for example say i make
a script which prints out all the links on another URL....how can i run
that?
thanks!


Here is a start. Put the following in your cgi-bin folder or equivalent.
Name it test.cgi
#!/usr/bin/python

print "Content-Type: text/plain\n\n"
print "Hello, World!\n"
Now just browse it. E.g.:

http://www.doe-mbi.ucla.edu/cgi/jstroud/ex-1.1.cgi
James
Jan 22 '06 #2
py schrieb:
i have a website which runs apache on linux. it supports python (i
think via cgi....not sure how else). anyway how can I go to a web page
and run a python script or something like that? for example say i make
a script which prints out all the links on another URL....how can i run
that?


Here is an audio introduction to CGI programming with Python:

http://libsyn.com/media/awaretek/Pyt...050813_CGI.mp3
Jan 23 '06 #3

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

Similar topics

0
1808
by: Irmen de Jong | last post by:
QOTW: "Giving full access rights to a secretary or new programmer ought to insure an occasional random file deletion." -- Raymond Hettinger "I always use join, but that's probably because that...
0
2561
by: O'Neal Computer Programmer | last post by:
*** First of all, if there is a previous post on Temple of Elemental Evil, please provide a link to that/them so in order to create a larger resource on this game. Thanks! (Merci) ;-) *** Temple...
0
1162
by: Simon Brunning | last post by:
QOTW: "Discussing goto statements and Microsoft together is like mixing dynamite and gasoline." - DH '"Spaghetti" doesn't quite describe it. I've settled on "Lovecraftian": reading the code, you...
12
1568
by: Ray | last post by:
Hello, I've got the chance to determine the technology to use in creating a product similar to this: http://www.atomicisland.com/ Now the thing is that I need to sell this to the guy with...
15
1851
by: John Salerno | last post by:
Can anyone tell me how complicated it might be to install Python on my server so I can use it for web apps? Is it a one-time process, or something to maintain? Thanks.
53
4285
by: Michael Tobis | last post by:
Someone asked me to write a brief essay regarding the value-add proposition for Python in the Fortran community. Slightly modified to remove a few climatology-related specifics, here it is. I...
9
12807
by: walterbyrd | last post by:
If I wanted to build a website with forums, news feeds, galleries, event calander, document managment, etc. I do so in Joomla easily. But, I would perfer to use django/python, if that would be at...
10
4346
by: Ohmster | last post by:
I am trying to use this cool script that some MIT guy wrote and it just does not work, I get a stream of errors when I try to run it. It is supposed to visit a URL and snag all of the pictures on...
0
938
by: Yansky | last post by:
Hi, I'm having a lot of problems getting any Python scripts to run on my website. I have put them in the cgi-bin directory and chmodded both the directory and files to 755. But when I try to access...
0
234
by: Gabriel Genellina | last post by:
En Wed, 16 Apr 2008 07:37:55 -0300, Good Z <goodz158@yahoo.comescribió: If the Java class implements Base64 as defined in RFC 3548, it should be compatible with the Python base64 module. Try...
0
7118
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,...
0
6980
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
7192
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...
1
6862
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
5452
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,...
1
4886
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...
0
4579
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...
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
282
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...

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.