×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    24

    start_new_thread problem

    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
    Last edited by zell1983; 2005-05-25 at 09:48.

  2. #2
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: start_new_thread problem

    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

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    24
    thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×