By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,171 Members | 809 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,171 IT Pros & Developers. It's quick & easy.

wx.ProgressDialog is not returning a Tuple

P: 7
Hi all,
I'm trying to get the
(continue, skip) = wx.ProgressDialog(...)
but I keep getting an error

I stole the code below from another post regarding the wx.ProgressDialog and it was reported as working there but it gives me the same error.

Expand|Select|Wrap|Line Numbers
  1.  
  2. (before) count: 1, keepGoing: True, skip: False 
  3. Traceback (most recent call last):
  4.   File "progdial.py", line 28, in <module>
  5.     (keepGoing, skip) = dlg.Update(count, newtext)
  6. TypeError: 'bool' object is not iterable
  7.  
  8.  


Expand|Select|Wrap|Line Numbers
  1. import wx
  2. import time
  3.  
  4. max = 10
  5. app = wx.PySimpleApp()
  6. dlg = wx.ProgressDialog("Progress dialog example",
  7. "variables to be shown here",
  8. maximum = max,  
  9. style = wx.PD_CAN_ABORT
  10. | wx.PD_CAN_SKIP
  11. #| wx.PD_APP_MODAL
  12. | wx.PD_ELAPSED_TIME  
  13. | wx.PD_ESTIMATED_TIME
  14. | wx.PD_REMAINING_TIME
  15. )
  16.  
  17. keepGoing = True
  18. skip = False
  19. count = 0
  20.  
  21. while keepGoing and count < max:
  22.   count += 1
  23.   wx.MilliSleep(1000)
  24.   #time.sleep(1)
  25.   newtext = "(before) count: %s, keepGoing: %s, skip: %s " % \
  26.   (count, keepGoing, skip)
  27.   print newtext
  28.   (keepGoing, skip) = dlg.Update(count, newtext)
  29.   newtext = "(after) count: %s, keepGoing: %s, skip: %s " % \
  30.   (count, keepGoing, skip)
  31.   print newtext
  32.  
  33. dlg.Destroy()
  34.  
  35.  
I am using Python 2.6.2 and python-wxgtk2.8 on Ubuntu 9.04

Any suggestions are greatly appreceiated, I haven't been able to google up anyone with the same problem.

EJ
Oct 19 '10 #1
Share this Question
Share on Google+
2 Replies


P: 7
Nevermind
I did a wxversion.select('2.8') and that seems to work.

How can I set that as the default?
Oct 19 '10 #2

P: 7
In the above code, the skip value is False only for the first iteration. It becomes True after the fist Update() call even if the Skip button has been pushed.

Has anyone else seen this problem?
Whats going on?

EJ
Oct 22 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.