Solved

Running on webpage

Posted on 2013-01-24
6
256 Views
Last Modified: 2013-01-26
How can I run the attached python script on a web page?

Thanks
mesure-volume.py
0
Comment
Question by:ayha1999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 200 total points
ID: 38813819
follow this guidelines:
HOWTO Use Python in the web
0
 
LVL 17

Assisted Solution

by:gelonida
gelonida earned 200 total points
ID: 38813839
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
 
LVL 4

Assisted Solution

by:eivo
eivo earned 100 total points
ID: 38813841
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 17

Assisted Solution

by:gelonida
gelonida earned 200 total points
ID: 38813850
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
 
LVL 16

Expert Comment

by:Valeri
ID: 38813891
are you familiar with html?
I hope it will help you: http://python.about.com/od/cgiformswithpython/ss/pycgitut2.htm
0
 
LVL 7

Author Closing Comment

by:ayha1999
ID: 38823438
Thanks
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question