469,306 Members | 1,987 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

How do you do this in python?


In bash, you'd do this with the perl interpreter

Issue the perl command via -e switches on the shell command line:
perl -e 'print "Hello, world\n"'

or

Pass your script to Perl via standard input:
echo "print 'Hello, world'" | perl -

How would you do the above with the python interpreter in bash?

Nov 4 '05 #1
2 1098
ca**********@gmail.com wrote:
perl -e 'print "Hello, world\n"'


python -c 'print "Hello, world"'

Cheers,

--
Klaus Alexander Seistrup
Copenhagen, Denmark
http://seistrup.dk/
Nov 4 '05 #2
ca**********@gmail.com wrote:
Pass your script to Perl via standard input:
echo "print 'Hello, world'" | perl -


$ echo "print 'hello, world'" | python -
hello, world

Cheers,

--
george
Nov 4 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Olaf Meyer | last post: by
reply views Thread by Kurt B. Kaiser | last post: by
1 post views Thread by Jerald | last post: by
reply views Thread by Kurt B. Kaiser | last post: by
reply views Thread by Kurt B. Kaiser | last post: by
reply views Thread by Kurt B. Kaiser | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.