python -c "print 'hi.'"
# or
echo "print 'hi.'" | python '-'
# equal to
echo "print 'hi.'" | python -- -
Execute multiline code:
python '-' <<"EOF"
lines=2
print "\nThis script is %i lines long.\n" %(lines,)
EOF
Using json.tool to validate and pretty-print:
curl https://app01.nutshell.com/api/v1/json | python -m json.tool
No comments:
Post a Comment