You Are Here:

Community: Developer Discussion Boards

#1 Old appuifw.Text AttributeError - 2008-03-23, 15:37

Join Date: Feb 2005
Posts: 9
rshd1234
Offline
Registered User
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'
Reply With Quote

#2 Old Re: appuifw.Text AttributeError - 2008-03-23, 15:57

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
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.
Reply With Quote

#3 Old Re: appuifw.Text AttributeError - 2008-03-23, 18:08

Join Date: Feb 2005
Posts: 9
rshd1234
Offline
Registered User
thanks ,
i fix the error : i forget the bracktes ()

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

now it work.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
telephone.call_state AttributeError maverick4ml Python 0 2008-01-08 22:08
problem with canvas.text and appuifw.text luke14free Python 1 2006-11-01 10:43
Formating color, style appuifw.Text not work adywicaksono Python 3 2006-05-03 07:39
Does appuifw.Text input support normal text? bercobeute Python 2 2006-02-22 09:43
appuifw.Text() bug ? sznever Python 2 2005-07-05 15:31

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia