March 15, 2004
Instant web server

Instant web server.

Every now and again, even I'm amazed by how cool Python is.

Hey, how about combining this with Hans' Windows Explorer integration? Right click on a folder, "Serve from here"? I'll give this a bash at lunchtime...

Posted to Python by Simon Brunning at March 15, 2004 10:59 AM
Comments

I've seen this posted a few places with links to Kevin's weblog, and nowhere to mine! *sob* I'll have to go elsewhere for my ego stroking!

Posted by: Aaron Brady on March 15, 2004 01:37 PM

Sorry!

Via Aaron[1]. ;-)

Anyway, surely the fact that Kevin reads your blog is enough of an ego stroke?

[1] http://insom.me.uk/blog/Tech/Python/webhere.writeback

Posted by: Simon Brunning on March 15, 2004 01:39 PM

http://insom.me.uk/blog/Tech/Python/webhere2.writeback

As requested :p

Posted by: Aaron Brady on March 15, 2004 02:04 PM

Awesome, Aaron!

Posted by: Simon Brunning on March 15, 2004 02:21 PM

For some reason, the syntax
python -c '__import__("SimpleHTTPServer").test()'
didn't work on my system at work running XP.

What did work was this:
python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"

Posted by: christian on March 15, 2004 04:44 PM

I wondered about the syntax of Aaron's original post, but I tested on my Mac and then posted to my blog before trying it out on Windows. The syntax Christian uses is certainly what I would have expected and is much simpler. I'm going to update my blog post to use that since it is Unix-friendly too and simplifies the stupid csh alias quoting too.

ka

Posted by: Kevin Altis on March 15, 2004 07:41 PM

hi
i'm new to Python & downloaded python 2.3 for win2k.i have seen a documentation on http://altis.pycs.net/2004/03/14.html#a96 stating that PCs can become a web server,but i could'nt configure the following command- python -c "import SimpleHTTPServer;SimpleHTTPServer.test()" .i got the following error.
SyntaxError: invalid syntax. can u guide me
Also how can one move to Directory,'Myserver' using python command?
thanxs
vinod

Posted by: Vinod on May 3, 2004 08:21 AM

python -c "import SimpleHTTPServer;SimpleHTTPServer.test()" works fine for me, Vinod. What's the *exact* message that you get?

Oh, just a thought - you need to run this from a *Window* command line, not from withing the Python interpretor.

You can change the current working directory using os.chdir() - not that I'd recommend it.

Posted by: Simon Brunning on May 4, 2004 10:30 AM

Python is cool, mailman works gut but I dont want to learn another language.

Posted by: Dzwonki Gry Java on June 30, 2004 10:02 PM

Nice work chaps.

turning this in to a nautilus-script as I type...

Posted by: airtonix on December 9, 2007 02:01 PM

eastern hancock central high school mens penis amd balls gay ski weekend breast implants gone wrong

Posted by: Sasha on October 27, 2008 08:13 AM

free gay jerk offf hoodcanalbridge shiawassee county michigan distinguish between sexual and asexual reproduction in the hydra.

Posted by: Future_dim on October 29, 2008 06:54 AM

Posted by: Future_dim on October 30, 2008 04:39 AM

Posted by: Future_dim on November 1, 2008 05:24 AM

Posted by: Future_dim on November 4, 2008 02:44 PM
Post a comment
Name:


Email Address:


URL:



Comments:


Remember info?