0

I'm attempting to give users of my script a dead easy way of running it. I'll tell them to just launch Terminal, paste this in, and hit enter:

curl https://dl.dropboxusercontent.com/u/60354330/SCMR_Installer.py | python

The script properly downloads and starts (yay), and it doesn't even leave the .py file anywhere on their system, but the moment my script hits a line where it needs input, it terminates saying:

Traceback (most recent call last):
  File "<stdin>", line 165, in <module>
  File "<stdin>", line 36, in yesOrNo
EOFError: EOF when reading a line

So... my question is, how do I make it so that as soon as my script starts, it's able to receive user input?

(By the way, that's the actual url to the script, so you can really check it out right now if you want.)

1

1 Answer 1

1
/path/to/curl https://dl.dropboxusercontent.com/u/60354330/SCMR_Installer.py | /path/to/python <<-EOF
yes
EOF

You need a here document - the yes is the answer the user would have typed.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, but I found an even simpler way of doing this from the comment on the question: python <(curl https://dl.dropboxusercontent.com/u/60354330/SCMR_Installer.py). Add that into your answer and I'll accept it.
It's common courtesy to upvote a comment if it helped you and/or thank the commenter, especially if it actually answered your question.
@AlexHall - All the upvote does for you is your comment is it's less likely to be hidden, but I doubt there will be further comments on this question so your comment isn't at danger of being hidden. You don't get any rep for it. I suppose it might help you get the pundit badge, but that requires 5 upvotes on 10 comments, and I find it doubtful that your one comment here will ever get 5 upvotes. Anyways, I upvoted it since you seem to care.
I'm surprised about the rep. What I really want is some kind of notification when I help someone, it feels good and it motivates me to help others on the site. Getting rep will do that but if I answered your question a thank you comment seems most appropriate. Had I not refreshed the page I wouldn't have known that my comment helped. Seeing you offer to mark someone else's answer as correct if they add information that not only they didn't come up with but you got via my comment stings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.