Connecting Tech Pros Worldwide Forums | Help | Site Map

Help me to solve this error

Newbie
 
Join Date: May 2007
Posts: 7
#1: May 23 '07
ValueError: need more than 1 value to unpack . This is the error I get

when I am using pyRXPU in the one of the scripts to get the strings from an application. Can anybody throw some light on this ..what might be the solution for this.

Error information for the reference :

Traceback (most recent call last):
File "D:\LanguageScripts\Screens.py", line 106, in test_1_01_DoSomething
TitlenSoftkeyfn()
File "D:\LanguageScripts\EventLog_Screens.py", line 66, in TitlenSoftkeyfn
titleBar = root.TitleBar.currentText
File "D:\LanguageScripts\XmlWrapper.py", line 35, in __getattr__
tagName, attrs, children, spare = child
ValueError: need more than 1 value to unpack

bvdet's Avatar
Moderator
 
Join Date: Oct 2006
Location: Nashville, TN
Posts: 1,563
#2: May 23 '07

re: Help me to solve this error


Quote:

Originally Posted by pythonuser

ValueError: need more than 1 value to unpack . This is the error I get

when I am using pyRXPU in the one of the scripts to get the strings from an application. Can anybody throw some light on this ..what might be the solution for this.

Error information for the reference :

Traceback (most recent call last):
File "D:\LanguageScripts\Screens.py", line 106, in test_1_01_DoSomething
TitlenSoftkeyfn()
File "D:\LanguageScripts\EventLog_Screens.py", line 66, in TitlenSoftkeyfn
titleBar = root.TitleBar.currentText
File "D:\LanguageScripts\XmlWrapper.py", line 35, in __getattr__
tagName, attrs, children, spare = child
ValueError: need more than 1 value to unpack

Expand|Select|Wrap|Line Numbers
  1. >>> a,b,c,d=[1,]
  2.  
  3. Traceback (most recent call last):
  4.   File "<pyshell#0>", line 1, in -toplevel-
  5.     a,b,c,d=[1,]
  6. ValueError: need more than 1 value to unpack
  7. >>> 
The length of sequence 'child' does not match the number of variables.
bartonc's Avatar
Moderator
 
Join Date: Sep 2006
Location: Minden, Nevada, USA
Posts: 6,400
#3: May 23 '07

re: Help me to solve this error


Quote:

Originally Posted by pythonuser

ValueError: need more than 1 value to unpack . This is the error I get

when I am using pyRXPU in the one of the scripts to get the strings from an application. Can anybody throw some light on this ..what might be the solution for this.

Error information for the reference :

Traceback (most recent call last):
File "D:\LanguageScripts\Screens.py", line 106, in test_1_01_DoSomething
TitlenSoftkeyfn()
File "D:\LanguageScripts\EventLog_Screens.py", line 66, in TitlenSoftkeyfn
titleBar = root.TitleBar.currentText
File "D:\LanguageScripts\XmlWrapper.py", line 35, in __getattr__
tagName, attrs, children, spare = child
ValueError: need more than 1 value to unpack

Search for "child ?=" (regex); the sourse must be a list, tuple, comprehension or generator; not a single object as it is now.
Newbie
 
Join Date: May 2007
Posts: 7
#4: May 24 '07

re: Help me to solve this error


Quote:

Originally Posted by bvdet

Expand|Select|Wrap|Line Numbers
  1. >>> a,b,c,d=[1,]
  2.  
  3. Traceback (most recent call last):
  4.   File "<pyshell#0>", line 1, in -toplevel-
  5.     a,b,c,d=[1,]
  6. ValueError: need more than 1 value to unpack
  7. >>> 
The length of sequence 'child' does not match the number of variables.

************************************************** **********

Will check out the code again.Thanx for the reply
Newbie
 
Join Date: May 2007
Posts: 7
#5: May 24 '07

re: Help me to solve this error


Quote:

Originally Posted by bartonc

Search for "child ?=" (regex); the sourse must be a list, tuple, comprehension or generator; not a single object as it is now.

**************************************************

Tahnks for the reply. But I have a question... What do you mean by Search for "child ?=" (regex); . Anyways I will check out if the source is one of those mentioned above
Newbie
 
Join Date: May 2007
Posts: 7
#6: May 24 '07

re: Help me to solve this error


Quote:

Originally Posted by pythonuser

**************************************************

Tahnks for the reply. But I have a question... What do you mean by Search for "child ?=" (regex); . Anyways I will check out if the source is one of those mentioned above

I have checked the code... The child what Iam getting is of the type 'Unicode'.

I tried to get the strings using pyRXP. When pyRXP is used the type of the child is a tuple. Now I dont have a clue what to do??
bartonc's Avatar
Moderator
 
Join Date: Sep 2006
Location: Minden, Nevada, USA
Posts: 6,400
#7: May 24 '07

re: Help me to solve this error


Quote:

Originally Posted by pythonuser

I have checked the code... The child what Iam getting is of the type 'Unicode'.

I tried to get the strings using pyRXP. When pyRXP is used the type of the child is a tuple. Now I dont have a clue what to do??

Quote:

Originally Posted by Barton

Search for "child ?=" (regex)

Regular Expression search: the '?' means maybe a space, maybe not.
Quote:
the sourse must be a list, tuple, comprehension or generator; not a single object as it is now.
The tuple is what you are looking for.
Newbie
 
Join Date: May 2007
Posts: 7
#8: May 24 '07

re: Help me to solve this error


How we can change the unicode type to a tuple type.
Reply