while True:
mess = raw_input('Type: ')
//other stuff
While user doesn’t type anything, I can’t do //other stuff. How can I do, that other stuff would be executed, but, if user types anything at that time, mess would change its value?
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 should spawn your other stuff in a worker thread.
This is a trivial example with
messas a global. Note that for thread-safe passing of objects between worker thread and main thread, you should use aQueueobject to pass things between threads, don’t use a global.