Running on webpage

How can I run the attached python script on a web page?

Thanks
mesure-volume.py
LVL 7
ayha1999Asked:
Who is Participating?
 
Meir RivkinConnect With a Mentor Full stack Software EngineerCommented:
follow this guidelines:
HOWTO Use Python in the web
0
 
gelonidaConnect With a Mentor Commented:
The anser to this is rather complicated and depends a lot on which server you want to run your script on.

1.) Do you want to run a program on your own PC and then just control it with your own web browser by connecting for example to a url of the type
http://localhost:8000/mypythonscript 

2.) Do you have some web server, where you can upload files to?
If you want to run it on some existing web server.
What does this server provide

2.a) Is python installed on the server?
2.b) How does the server support python scripts?
    - via CGI?
    - via WSGI ?
    - via FastCGI?
   - via mod_python ?

I can try to give you some hints, but  the answer depends heavily on what you mean exactly with 'running on a web page'.
0
 
eivoConnect With a Mentor Commented:
You could try migrating your script to web.py (http://webpy.org/). you'll end up running your own webserver, however and the leg work will be quite excessive.

In short, the answer is it's complicated. You need a webserver, probably with mod_python to get going.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
gelonidaConnect With a Mentor Commented:
It's definitely worth reading sedgwick's link It gives you a good idea about the different ways to run python 'in the web'

Afterwards as I wrote in my previous post it's up to you to identify your 'scenario'.

If you never wrote code for the web, then you'll notice, that coding for the web is very different to coding a stand alone program.
Web applications are request based and ('stateless'), so you had to to something like.

- display a web form, which allows you to upload your stl file
- then write the code, which can read the uploaded file and create the according text and render it as html.

Not very complicated but different to a standalone application.

Thinks you had to learn for this:
- creating web forms
- handling file uploads
- creating html output
0
 
ValeriCommented:
are you familiar with html?
I hope it will help you: http://python.about.com/od/cgiformswithpython/ss/pycgitut2.htm
0
 
ayha1999Author Commented:
Thanks
0
All Courses

From novice to tech pro — start learning today.