[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.
> http://commandlinefu.com/
>
> 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

>
>
> --
> ~noufal
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
-Anand


More information about the BangPypers mailing list