×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    9

    appuifw.Text AttributeError

    How to fix this error :

    import appuifw
    text= appuifw.Text
    pth="c:\\test2.txt"
    f=open(pth,'r')
    text.set(Unicode(f.read().decode('utf_8')))
    f.close()

    the error return : AttributeError: 'builtin_function_or_method' object has no attribute 'set'

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

    Re: appuifw.Text AttributeError

    Quote Originally Posted by rshd1234 View Post
    How to fix this error :

    import appuifw
    text= appuifw.Text
    pth="c:\\test2.txt"
    f=open(pth,'r')
    text.set(Unicode(f.read().decode('utf_8')))
    f.close()

    the error return : AttributeError: 'builtin_function_or_method' object has no attribute 'set'
    Are you trying to write the content of the file to appuifw.Text()?
    If so, try:
    Code:
    import appuifw
    
    text=appuifw.Text()
    pth="c:\\test2.txt"
    f=open(pth,'r')
    text.add(u"%s" % (f.read().decode('utf_8')))
    f.close()
    
    appuifw.app.body=text  #This line is so you can see the result immediately
    The function that needs to be used is "add", not "set". Also Unicode(f.read().decode('utf_8')) returned an error in my case, so I did it a bit differently, as you can see.

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    9

    Re: appuifw.Text AttributeError

    thanks ,
    i fix the error : i forget the bracktes ()

    text= appuifw.Text => text= appuifw.Text()

    now it work.

Similar Threads

  1. telephone.call_state AttributeError
    By maverick4ml in forum Python
    Replies: 0
    Last Post: 2008-01-08, 21:08
  2. problem with canvas.text and appuifw.text
    By luke14free in forum Python
    Replies: 1
    Last Post: 2006-11-01, 09:43
  3. Formating color, style appuifw.Text not work
    By adywicaksono in forum Python
    Replies: 3
    Last Post: 2006-05-03, 06:39
  4. Does appuifw.Text input support normal text?
    By bercobeute in forum Python
    Replies: 2
    Last Post: 2006-02-22, 08:43
  5. appuifw.Text() bug ?
    By sznever in forum Python
    Replies: 2
    Last Post: 2005-07-05, 14:31

Posting Permissions

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