[BangPypers] Command line goodies
Anand Balachandran Pillai
abpillai at gmail.com
Wed Mar 25 13:59:57 CET 2009
On Wed, Mar 25, 2009 at 5:19 PM, Noufal Ibrahim <noufal at gmail.com> wrote:
> I found this via. hacker news.
> It's a repository of command line tricks.
> I found a python one
> python -m SimpleHTTPServer
> which serves the current directory on port 8000
> I've not really seen many python one liners. The language culture and
> the indentation requirement discourage that kind of thing I imagine.
Really ? FYI, Python is full of one-liners both of the command-line
variety and the code variety.
Here is one which works as a miniature wget using urllib.
$ python -m urllib <url> > <file>
For example, to save http://www.python.org to a local file,
python -m urllib http://www.python.org > python.html
> BangPypers mailing list
> BangPypers at python.org
More information about the BangPypers