You Are Here:

Community: Developer Discussion Boards

#1 Old reading text problem? - 2008-08-25, 11:05

Join Date: Aug 2008
Posts: 148
cool_eagle
Offline
Regular Contributor
Code:
import codecs,e32,appuifw

path = "E:\\a.txt"

def read_settings_array():
   f = codecs.open(path, 'r', 'utf8')
   settingsfile = f.read()
   settings = settingsfile.split(":");
   f.close()
   return settings
o=read_settings_array()[1]
e32.ao_sleep(o)
appuifw.note(u'ok')
and i take this error:
e32.ao_sleep(o)
TypeError: bad argument type for built-in operation
i hope u
Reply With Quote

#2 Old Re: reading text problem? - 2008-08-25, 11:06

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
Quote:
Originally Posted by cool_eagle View Post
Code:
import codecs,e32,appuifw

path = "E:\\a.txt"

def read_settings_array():
   f = codecs.open(path, 'r', 'utf8')
   settingsfile = f.read()
   settings = settingsfile.split(":");
   f.close()
   return settings
o=read_settings_array()[1]
e32.ao_sleep(o)
appuifw.note(u'ok')
and i take this error:
e32.ao_sleep(o)
TypeError: bad argument type for built-in operation
i hope u
hi i think you have written o instead of zero(0).


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#3 Old Re: reading text problem? - 2008-08-25, 11:11

Join Date: Aug 2008
Posts: 148
cool_eagle
Offline
Regular Contributor
Quote:
Originally Posted by gaba88 View Post
hi i think you have written o instead of zero(0).
text= wait:5
or
text= wait:15

i want to use content of text
Reply With Quote

#4 Old Re: reading text problem? - 2008-08-25, 11:20

Join Date: Aug 2008
Posts: 148
cool_eagle
Offline
Regular Contributor
plz help me
Reply With Quote

#5 Old Re: reading text problem? - 2008-08-25, 11:24

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
Quote:
Originally Posted by cool_eagle View Post
text= wait:5
or
text= wait:15

i want to use content of text
i cant get you properly but i am feeling that you want make a wait.
try this i have modified your code.
Code:
import codecs,e32,appuifw

path = "E:\\a.txt"

def read_settings_array():
   f = codecs.open(path, 'r', 'utf8')
   settingsfile = f.read()
   settings = settingsfile.split(":");
   f.close()
   return settings
o=read_settings_array()[1]
e32.ao_sleep(0)
appuifw.note(u'ok')
EDIT: and if you want a proper solution then please explain the question properly.


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#6 Old Re: reading text problem? - 2008-08-25, 11:33

Join Date: Aug 2008
Posts: 148
cool_eagle
Offline
Regular Contributor
Quote:
Originally Posted by gaba88 View Post
i cant get you properly but i am feeling that you want make a wait.
try this i have modified your code.
Code:
import codecs,e32,appuifw

path = "E:\\a.txt"

def read_settings_array():
   f = codecs.open(path, 'r', 'utf8')
   settingsfile = f.read()
   settings = settingsfile.split(":");
   f.close()
   return settings
o=read_settings_array()[1]
e32.ao_sleep(0)
appuifw.note(u'ok')
EDIT: and if you want a proper solution then please explain the question properly.
i dont want to zero (0)
i want use content of text...
example : e\\a.txt = 15 , 23
i want to wait by the text
Reply With Quote

#7 Old Re: reading text problem? - 2008-08-25, 11:35

Join Date: Aug 2008
Posts: 148
cool_eagle
Offline
Regular Contributor
Code:
import codecs,e32,appuifw

path = "E:\\a.txt"

def read_settings_array():
   f = codecs.open(path, 'r', 'utf8')
   settingsfile = f.read()
   settings = settingsfile.split(":");
   f.close()
   return settings
t=read_settings_array()[1]
e32.ao_sleep(t)
appuifw.note(u'ok')
and i take this error:
e32.ao_sleep(t)
TypeError: bad argument type for built-in operation

i want to tell it
Reply With Quote

#8 Old Re: reading text problem? - 2008-08-25, 11:43

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
In that case, the problem is that you are trying to pass a string as an argument instead of an integer. Try this:
Code:
import codecs,e32,appuifw

path = "E:\\a.txt"

def read_settings_array():
   f = codecs.open(path, 'r', 'utf8')
   settingsfile = f.read()
   settings = settingsfile.split(":")
   f.close()
   return settings
t=read_settings_array()[1]
e32.ao_sleep(int(t))
appuifw.note(u'ok')
Reply With Quote

#9 Old Re: reading text problem? - 2008-08-25, 11:47

Join Date: Aug 2008
Posts: 148
cool_eagle
Offline
Regular Contributor
Quote:
Originally Posted by bogdan.galiceanu View Post
In that case, the problem is that you are trying to pass a string as an argument instead of an integer. Try this:
Code:
import codecs,e32,appuifw

path = "E:\\a.txt"

def read_settings_array():
   f = codecs.open(path, 'r', 'utf8')
   settingsfile = f.read()
   settings = settingsfile.split(":")
   f.close()
   return settings
t=read_settings_array()[1]
e32.ao_sleep(int(t))
appuifw.note(u'ok')

thanks for it.

my app is running
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
Problem of text not getting displayed in CAknTextQueryDialog on e61i neekasa General Symbian C++ 9 2009-07-10 14:56
Problem while Reading text file in Nokia3650 lalithunt Mobile Java General 5 2008-07-30 18:19
A problem reading a text in mobile aamitgupta Mobile Java General 3 2008-01-14 16:35
ENumerated text Control Problem j_b_luo Carbide.c++ IDE and plug-ins 1 2007-11-30 22:41
Problem on getting item text from listbox imjude General Symbian C++ 2 2007-11-27 14:55

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