News for hackers. Stuff that matters.
Re:Python command line oneliners by keenerd on Wednesday February 20, 2013 @08:46AM (#5250352)
I am arguing it is not even useful for that. If you simply want to share files across a LAN (the use case for these oneliners), SimpleHTTPServer falls flat on its face. It'll transfer large files at DSL-like rates and time out completely on directories with large numbers of files in them.

What are you supposed to do with an http server after getting one quickly? Stare at the open port? The only thing quick about SimpleHTTPServer is the startup time. Don't actually try using the server.

The specific instance that put me off of the python servers was when a friend downloaded a CableGate tarball and someone else wanted to look at it. No one had a flash drive on them, but the fellow did have python installed. One SimpleHTTPServer later and the tarball was being transferred at 100KB/sec, slower than the original download. The cables were all html anyway so let's try uncompressing the tarball and serving those. Now the server would time out instead.

What do people actually use SimpleHTTPServer for?

Re:Python command line oneliners by crdoconnor on Wednesday February 20, 2013 @09:11AM (#5250459)
I'm using it right now to serve up HTML files which I'm testing my (python) screen scraper on.

It means I can develop offline.

Re:Python command line oneliners by georgefox on Wednesday February 20, 2013 @12:04PM (#5251603)
> What do people actually use SimpleHTTPServer for?

I've used it as a half-baked and very short-lived file-sharing mechanism before, similar to what you describe above. I haven't noticed the DSL-like transfer rates because my broadband ISP gives me dialup-like upload speeds.

Re:Python command line oneliners by lucian1900 on Wednesday February 20, 2013 @09:16AM (#5250492)
One thing I use it for often is serving HTML so I get the correct origin in browsers. Some development servers are also based on it.

Yes, it's terrible. But not useless.

Re:Python command line oneliners by dschep on Wednesday February 20, 2013 @09:17AM (#5250500)
> What do people actually use SimpleHTTPServer for?

Smaller files than you need to move around when using a 1 off http server.

Re:Python command line oneliners by ersii on Wednesday February 20, 2013 @02:39PM (#5252741)
It's a good HTTPD Dummy. I've mostly used it in debugging purposes - a little as a swiss army knife.

It's not that useless that you're portraying it as. But I do however agree that it's below toy level. It's not for production or long-time use.

Re:Python command line oneliners by keenerd on Thursday February 21, 2013 @03:09PM (#5259956)
Yeah, it does seem a little useful for lightweight development and testing. Though I find it bizarre that anyone doing professional web development can't spare the 1MB for an Nginx or Lighttpd install.
Re:Python command line oneliners by pindi on Wednesday February 20, 2013 @05:28PM (#5253823)
When developing Javascript apps locally, I often use SimpleHTTPServer so I can access them through http:// rather than file:/// URLs, which tend to interact badly with the same-origin policy.