The Artima Developer Community
Sponsored Link

Python Buzz Forum
Instant Web Server

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Kevin Altis

Posts: 66
Nickname: altis
Registered: Aug, 2003

Kevin Altis is the lead developer for PythonCard
Instant Web Server Posted: Mar 14, 2004 11:49 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Kevin Altis.
Original Post: Instant Web Server
Feed Title: Kevin Altis' Weblog
Feed URL: http://altis.pycs.net/rss.xml
Feed Description: Python, Open Source, PythonCard
Latest Python Buzz Posts
Latest Python Buzz Posts by Kevin Altis
Latest Posts From Kevin Altis' Weblog

Advertisement

When I need to serve up a few files for friends or try out some CGIs, XML-RPC, etc. I generally just fire up the PythonCard webserver sample. However, I find the following single line at a command prompt to be quite appealing for an instant web server.

    python -c '__import__("SimpleHTTPServer").test()'

It works on any OS where you have Python installed and since you can cd (change directory) to the dir you want to serve files from before running the command you don't have to mess with config files or moving files before serving them up. If you alias the command or make a batch file you won't have to remember the whole line. Here's an example run on my Mac.

[solo:~/Documents] altis% python -c '__import__("SimpleHTTPServer").test()'
Serving HTTP on 0.0.0.0 port 8000 ...
localhost - - [14/Mar/2004 09:27:09] "GET / HTTP/1.1" 200 -
localhost - - [14/Mar/2004 09:27:28] "GET /gingerbread.py HTTP/1.1" 200 -

[via insom.me.uk]

Read: Instant Web Server

Topic: SeaPIG Previous Topic   Next Topic Topic: log4j for dummies

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use