Python one-liner??

Discussion in 'Python' started by srinivasan srinivas, Aug 21, 2008.

  1. srinivasan srinivas, Aug 21, 2008
    #1
    1. Advertising

  2. srinivasan srinivas

    Matimus Guest

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


    The answer is python -c...

    but python -h is useful too.

    Matt
     
    Matimus, Aug 22, 2008
    #2
    1. Advertising

  3. srinivasan srinivas

    Paddy Guest

    On Aug 22, 10:03 pm, Matimus <> 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.
     
    Paddy, Aug 23, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?Morris_Carr=E9?=

    Python passes the Turing test with a one-liner !

    =?ISO-8859-1?Q?Morris_Carr=E9?=, Apr 1, 2004, in forum: Python
    Replies:
    1
    Views:
    349
    Jon Perez
    Apr 2, 2004
  2. Xah Lee
    Replies:
    0
    Views:
    350
    Xah Lee
    Oct 20, 2005
  3. @ Rocteur CC

    Python dos2unix one liner

    @ Rocteur CC, Feb 27, 2010, in forum: Python
    Replies:
    23
    Views:
    5,225
    Albert van der Horst
    Mar 12, 2010
  4. Raymond Hettinger

    Fun python 3.2 one-liner

    Raymond Hettinger, Mar 29, 2011, in forum: Python
    Replies:
    24
    Views:
    689
    Albert van der Horst
    Apr 14, 2011
  5. Larry
    Replies:
    1
    Views:
    106
    Martien Verbruggen
    Feb 3, 2005
Loading...

Share This Page