开发者

The best way to use python as a server scripting language for use on localhost

relatively long-time PHP user here. I could install XAMPP in my sleep at this point to the point where I can get a PHP script running in the browser at "localhost", but in my searches to find a similar path开发者_开发问答 using Python, I've run out of Googling ideas. I've discovered the mod_python Apache mod, but then I also discovered that it's been discontinued. I'd greatly prefer to do my Python learning in a browser as opposed to the command prompt, so if anybody could point me along the proper path, I'd be very grateful.

Thanks!


well mod_python has been retired. So in order to host python apps you want mod_wsgi

http://code.google.com/p/modwsgi/

But python isn't really like php(as in you mix it with html to get output, if I understand your question correctly). In learning python, using the command line/repl will probably be much more useful/straight forward I would think. If you are looking for python as primarily web development you should look into django (http://www.djangoproject.com/) as that might be closer to what you are looking for..


Most Python webframeworks have a built-in minimal development server:

  • Flask
  • Turbogears
  • Django
  • Pylons
  • web.py
  • web2py

But don't be afraid of the command line. Python has a great interactive console (just run python) and there's an even better one: IPython.


Many options, here are a couple:

  • mod_wsgi is an Apache module that is suitable for production environments

  • SimpleHTTPServer ships with Python and is easy to use

  • frameworks like Django or Twisted

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜