Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Python one-liner??

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


sri_annauni at yahoo

Aug 21, 2008, 5:24 AM

Post #1 of 6 (265 views)
Permalink
Python one-liner??

Hi,
Do we have python one-liner like perl one-liner 'perl -e'??
Thanks,
Srini


Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
--
http://mail.python.org/mailman/listinfo/python-list


gminick at bzt

Aug 22, 2008, 1:13 PM

Post #2 of 6 (248 views)
Permalink
Re: Python one-liner?? [In reply to]

-c?
--
http://mail.python.org/mailman/listinfo/python-list


redalastor at gmail

Aug 22, 2008, 1:25 PM

Post #3 of 6 (240 views)
Permalink
Re: Python one-liner?? [In reply to]

On Fri, Aug 22, 2008 at 4:13 PM, Wojtek Walczak <gminick [at] bzt> wrote:

> -c?
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Yup. Stands for command

python -c "print 'Hello World!'"
Hello World!


mccredie at gmail

Aug 22, 2008, 2:03 PM

Post #4 of 6 (239 views)
Permalink
Re: Python one-liner?? [In reply to]

> Do we have python one-liner like perl one-liner 'perl -e'??


The answer is python -c...

but python -h is useful too.

Matt
--
http://mail.python.org/mailman/listinfo/python-list


nytrokiss at gmail

Aug 22, 2008, 2:12 PM

Post #5 of 6 (242 views)
Permalink
Re: Python one-liner?? [In reply to]

What i use them for is to test for packages. e.g python -c "import django"


On Fri, Aug 22, 2008 at 2:03 PM, Matimus <mccredie [at] gmail> wrote:

> > Do we have python one-liner like perl one-liner 'perl -e'??
>
>
> The answer is python -c...
>
> but python -h is useful too.
>
> Matt
> --
> http://mail.python.org/mailman/listinfo/python-list
>



--
http://www.goldwatches.com/


paddy3118 at googlemail

Aug 22, 2008, 9:07 PM

Post #6 of 6 (225 views)
Permalink
Re: Python one-liner?? [In reply to]

On Aug 22, 10:03 pm, Matimus <mccre...@gmail.com> wrote:
> > Do we have python one-liner like perl one-liner 'perl -e'??
>
> The answer is python -c...
>
> but python -h is useful too.
>
> Matt

And Python is not optimised for one-liner solutions.
I have been known to construct multi-line -c arguments using
the bash shell on Unix (as bash supports multi-line quotes),
but creating and then deleting a temporary file saves me from
'quoting hell'.

- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.