I would like to get multiple commands from raw_input(). I have been using this:
reply = raw_input(">").split(' ')
command = reply[0]
file = reply[1]
but this seems very hacky to me is there a better way to do this in python?
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.
I believe the most pythonic way is
using tuple unpacking instead of indexing
In Python3.0+, you may use