Hi, running the code below in Pythonista is not working as expected. Looks like the worker thread is being "blocked" by raw_input whereas in other platforms (Raspberry Pi, Windows - both v.2.7.3) same code allows it to run in the background normally.
Can anybody reproduce this and help me understand if this is normal behaviour? Actually this code is just a simplification of what i'm trying to achieve with more complex code. I'm thinking this could probably be a particular iOS limitation.
Thanks for your kind assistance.
import threading
import time
class Worker():
def PrintSomething(self):
while True:
print "something"
time.sleep(1)
if __name__=="__main__":
worker=Worker()
wthread=threading.Thread(target=worker.PrintSomething)
wthread.start()
while True:
input=raw_input("Your input?: ") #waits for user input and currently blocks 'worker' thread in Pythonista
time.sleep(1)
Expected result would be something like:
Your input? : something
something
something
something
something
something
something
Your input? : something
something
...
But it throws just this:
something
Your input?: