Me and my friends are trying to make 2 apps for python.
In this 2 apps we use thread for make a connection to the net.
We use thread but we have this error:
TypeError:
start_new_thread()
takes at least 2 arguments ( 1 given )
if we call start_new_thread in this way:
thread.start_new_thread(self.getPage("502_01.jpg"),)
This error appear when the apps finish.
So we try yo call start_new_thread in this way:
thread.start_new_thread(self.getPage,("505_02.jpg",))
But the apps crash when execute start_new_thread..
What can we do?
Thanks to all
Originally posted by zell1983 Me and my friends are trying to make 2 apps for python.
In this 2 apps we use thread for make a connection to the net.
We use thread but we have this error:
TypeError:
start_new_thread()
takes at least 2 arguments ( 1 given )
if we call start_new_thread in this way:
thread.start_new_thread(self.getPage("502_01.jpg"),)
This error appear when the apps finish.
So we try yo call start_new_thread in this way:
thread.start_new_thread(self.getPage,("505_02.jpg",))
But the apps crash when execute start_new_thread..
What can we do?
Thanks to all
I can't really tell from the code you posted, since the essential parts are missing, but I suspect the culprit is, once again, using a native resource from the wrong thread. See: http://www.postneo.com/postwiki/moin.cgi/PythonGotchas