How can I make the following one liner print every file through Python?
python -c 'import sys;print '>>',sys.argv[1:]' | dir *.*
Specifically would like to know how to pipe into a python -c. DOS or Cygwin responses accepted.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can read data piped into a Python script by reading sys.stdin. For example:
It is not entirely clear what you want to do (maybe I am stupid). The confusion comes from your example which is piping data out of a python script.