0

I've seen in this link where everytime we will intiate webserver.py script which listens the user request & respond.

In Ubuntu we will usually run in Terminal.Similarly,i would like to know how to run the python file which is in the website.

Yuva Raj
  • 3,881
  • 1
  • 19
  • 30
  • Have you looked into actual web frameworks (django, web2py, flask, etc)? On the web, you'd have to find a host willing to let you use python's HttpServer as the host. I personally use Pythonanywhere.com to run my servers, but I believe they require you to use certain frameworks. – Snakes and Coffee Mar 06 '13 at 18:40
  • @SnakesandCoffee : To be honest, i don't know about web Frameworks! I have zero knowledge in that. Is there any way to run on our web site? It works in Ubuntu! – Yuva Raj Mar 06 '13 at 18:45

1 Answers1

0

[EDIT] Here are links to topics that will help you on your way

Flask/REST/JSON

Sandbox

Community
  • 1
  • 1
Craysiii
  • 25
  • 7
  • Thank you.! :) how can i set-up for my site? Is there any online tutorial (or) Guideline is available?u It will be much helpful if any of you provide some links! – Yuva Raj Mar 06 '13 at 18:54
  • I Dont want to run on my Ubuntu System! It works perfectly. I wanna to work the same in my site. – Yuva Raj Mar 06 '13 at 19:04
  • Where would you like to run it? @YuvaRaj – Craysiii Mar 06 '13 at 19:06
  • I need a better explaination of what you want to accomplish. – Craysiii Mar 06 '13 at 19:07
  • See here Craysii : http://postimage.org/image/c4t53kxmd/ Here,im using Php for Front End (Client Side) For Server Side im using Python to listen & respond the user request. My objective is to prepare an Online Compiler. In terminal i run my server python program simply as Python filename.py & now it starts to listen the port i.e localhost Whenever i execute my project..My Python program responds it! My above Screenshot ll make u clear i hope :) Similaly, i want to run this Code on my Web site. How the Python program intiate everytime? what should i do for that? – Yuva Raj Mar 06 '13 at 19:16
  • If you are trying to run the g++ compiler on the server through python, you would call subprocess, get the output of the compilation process, and branch from there. You could then create a textbox that acted as a console and using JSON get output from stdout and post input to stdin.I would def run this code in a sandbox. – Craysiii Mar 06 '13 at 19:21
  • Yeah! that's is my Objective. Can you elaborate (or) Provide any links? It ll be helpful for me to solve this problem :) – Yuva Raj Mar 06 '13 at 19:24
  • Well I would literally be building the system for you if I gave you an example haha. Give me a second and I'll throw some links in my answer to better accommodate you. BTW that sounds like an awesome project – Craysiii Mar 06 '13 at 19:26
  • Thank u! Now im in Chaos. I think i need to study alot to gain it. btw a small doubt @Craysii.. Whether g++ compiler already availalbe in our web server? (or) should we install it in our site like how we install in linux machine? – Yuva Raj Mar 06 '13 at 19:44
  • You need to consider how you plan to deploy your app. You are going to want a VPS or similar to host your server as well as run the code that is going to be compiled. In that instance, then yes you would install it the same as before – Craysiii Mar 06 '13 at 19:48