Do we have python equivalent of 'perl -e'??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • srinivasan srinivas

    Do we have python equivalent of 'perl -e'??

    HI,
    Like we run perl small code snippet using perl -e, do we have anything like that in python??
    Thanks,
    Srini



    Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mai...tools-08.html/
  • Ben Finney

    #2
    Re: Do we have python equivalent of 'perl -e'??

    srinivasan srinivas <sri_annauni@ya hoo.co.inwrites :
    Like we run perl small code snippet using perl -e, do we have
    anything like that in python??
    It's customary to check the usage summary of the program itself.

    =====
    $ python --help
    usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
    Options and arguments (and corresponding environment variables):
    -c cmd : program passed in as string (terminates option list)
    […]
    =====

    --
    \ “I got some new underwear the other day. Well, new to me.” —Emo |
    `\ Philips |
    _o__) |
    Ben Finney

    Comment

    • Peter Otten

      #3
      Re: Do we have python equivalent of 'perl -e'??

      srinivasan srinivas wrote:
      Like we run perl small code snippet using perl -e, do we have anything
      like that in python?? Thanks,
      $ python -c 'print "yes"'
      yes

      Peter

      Comment

      Working...