How do you do this in python?

C

casioculture

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?
 
G

George Yoshida

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

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

Cheers,
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,813
Messages
2,569,696
Members
45,486
Latest member
Deanna5597

Latest Threads

Top