×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    80

    Exclamation Error- first argument must be callable

    my code fragment:

    Code:
    		def receive(self):
    		c=0
    		prev=""
    		f= file(self.scr, "wb+")
    		while 1==1: #r != "\n" and r != "\r":
    			r = self.rep.read(1)
    			if r=="\n":
    				if prev == "\n":
    					c=c+1
    			prev=r
    			if c==8:
    				c=0
    				break
    			f.write(r)
    			f.flush()
    
    d = App()
    d.run()
    thread.start_new_thread(d.receive(), ())   
    d.close()

    the app runs fine initially, but the thread is executed only once, and when the thread is completed, the app crashes with " thread.start_new_thread(d.receive(), ()) - first argument must be callable"

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Error- first argument must be callable

    It seems you are actually calling the method instead of just specifying it. Try:
    Code:
    thread.start_new_thread(d.receive, ())

Similar Threads

  1. Replies: 8
    Last Post: 2010-07-05, 14:21
  2. unable to install application. Other applications must be closed first. Close now?
    By manjusg in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 3
    Last Post: 2009-12-22, 12:08
  3. Replies: 6
    Last Post: 2008-10-06, 16:10
  4. Replies: 2
    Last Post: 2007-12-03, 17:12
  5. Error:'aArrayFlat' : references must be initialized
    By Kapil Kaushik in forum Symbian
    Replies: 3
    Last Post: 2006-04-03, 11:46

Posting Permissions

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