You Are Here:

Community: Developer Discussion Boards

#1 Old raw_input - 2006-07-28, 18:14

Join Date: Jul 2006
Posts: 7
nokiameister
Offline
Registered User
This script works perfectly on the PC and on the Emulator:

Code:
while True:
	s = raw_input('Enter something : ')
	if s == 'quit':
		break
	if len(s) < 3:
		continue
	print(u'Length is at least 3!')
But on the phone (6680) it throws the following errors:

Code:
Enter something : Test
Traceback (most recent call last):
  File "E:\System\Apps\Python\default.py", line 60, in menu_action
    f()
  File "E:\System\Apps\Python\default.py", line 44, in query_and_exec
    execfile(os.path.join(this_dir, script_list[index]), globals())
  File "E:\System\Apps\Python\continue.py", line 2, in ?
    s = raw_input('Enter something : ')
TypeError: object.readline() returned non-string
any ideas?

Thanks in advance!
Reply With Quote

#2 Old Re: raw_input - 2006-07-29, 06:36

Join Date: Feb 2005
Posts: 30
dnastase's Avatar
dnastase
Offline
Registered User
I can reproduce the problem on my E70. Unfortunately I have no ideea why it does this
Reply With Quote

#3 Old Re: raw_input - 2006-08-01, 20:08

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Sorry for you

But in my phone your code works perfectly (no error !)
Except where I enter no character in the input prompt
I have following error
Code:
n=raw_input('>')
print n

Traceback (most recent call last):
File "<console>",
Line 1 , in ?
EOFError: EOF when reading a line


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#4 Old Re: raw_input - 2006-08-08, 15:51

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Quote:
Originally Posted by nokiameister
This script works perfectly on the PC and on the Emulator:

Code:
while True:
	s = raw_input('Enter something : ')
	if s == 'quit':
		break
	if len(s) < 3:
		continue
	print(u'Length is at least 3!')
But on the phone (6680) it throws the following errors:

Code:
Enter something : Test
Traceback (most recent call last):
  File "E:\System\Apps\Python\default.py", line 60, in menu_action
    f()
  File "E:\System\Apps\Python\default.py", line 44, in query_and_exec
    execfile(os.path.join(this_dir, script_list[index]), globals())
  File "E:\System\Apps\Python\continue.py", line 2, in ?
    s = raw_input('Enter something : ')
TypeError: object.readline() returned non-string
any ideas?

Thanks in advance!
This is due to a bug in series60_console. The readline method of the Console class returns a Unicode object instead of a string.

Filed as bug: https://sourceforge.net/tracker/inde...55&atid=790646
Reply With Quote

#5 Old Re: raw_input - 2006-08-25, 17:52

Join Date: Aug 2006
Posts: 15
aSaSSin0000
Offline
Registered User
Hello to everyone from a newbie of the forum and python

Is there any solution / workaround for this bug? I've a 6680 and I've the same problem!

I need an input box to enter an sms message first to send it to recipients...

Thanks in advance...

See ya!

P.s. sorry for wrong english and greetings from Italy!
Reply With Quote

#6 Old Re: raw_input - 2007-03-15, 22:00

Join Date: Mar 2007
Posts: 29
quickie
Offline
Registered User
hello,

i have the same problem on the e70. is there a solution to this? What's the correct way to read from stdin?


cheers,

flo
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

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