Have a function of the form:
def setup_my_object():
my_object = My_Object()
my_object_daemon = Pyro4.core.Daemon(port=55666)
Pyro4.Daemon.serveSimple({my_object: "my.object"},ns = False,daemon = my_object_daemon)
Pyro4 library allows to access the object over the network. Because the main process creates several different objects, a separate thread is created using:
def main():
threaded_object = threading.Thread(target = setup_my_object)
threaded_object.start()
The object is of the form (in reality constructor is more complicated).
class My_Object(object):
def __init__(self):
name_option = input('\nDo you want to enter a name? [y/n]:\n')
if (name_option == 'y')
self.m_name = add_name()
def add_name(self):
name = input('\nPlease enter the name: \n')
return(name)
The main() runs on a linux server, launched from a python console. The problem is when I launch main() the console never promts me "Do you want to enter a name?". I migh hit enter - wait for 30 seconds - nothing. Hit enter two times - wait for 30 seconds nothing. Only when I click enter like five times (and inadvertently the sixth) it will display "Do you want to enter a name?". What is going on and how do I avoid this, i.e. get an instant printout of "Do you want to enter a name?"?
Additional info: I am not seeing this problem when launching on a Windows machine; the problem is only on a Linux machine.