473,671 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wx.ProgressDial og is not returning a Tuple

7 New Member
Hi all,
I'm trying to get the
(continue, skip) = wx.ProgressDial og(...)
but I keep getting an error

I stole the code below from another post regarding the wx.ProgressDial og 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
2 1972
ejether
7 New Member
Nevermind
I did a wxversion.selec t('2.8') and that seems to work.

How can I set that as the default?
Oct 19 '10 #2
ejether
7 New Member
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

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

Similar topics

3
18191
by: Lukas Kasprowicz | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Folks, My Proglem is, I get after a query on a mysql database with module MySQLdb a tuple but I need this output from database as a string. can anybody help? - -------------- database ---------
10
5207
by: Carlo v. Dango | last post by:
Hello there. I have a function which as an argument takes a tuple and either returns that tuple or a mutated version of it. The problem is that tuples are imutable, hence I have to create a new tuple and copy the content of the old tuple to a new one. But how do I do this if I only at runtime know the size of the tuple? I wish I could pass around lists instead.. that would be so much easier, but I'm passing "*args" and "**kwargs" around...
1
2509
by: John Hunter | last post by:
I am writing a python extension module and have a reference counting question My function looks like static PyObject * pokereval_seven_cards(PyObject *self, PyObject *args) { int i;
29
3395
by: George Sakkis | last post by:
Why does slicing a tuple returns a new tuple instead of a view of the existing one, given that tuples are immutable ? I ended up writing a custom ImmutableSequence class that does this, but I wonder why it is not implemented for tuples. George
1
2871
by: Nuno Morgadinho | last post by:
Hello all, I'm messing around with the Server Programming Interface and the particular example presented at: http://www.postgresql.org/docs/current/interactive/spi-examples.html Ideally, I would want to make the example function return the information as a "set" and not through elog() so I can later access it and print it using PHP.
9
10892
by: Karl O. Pinc | last post by:
I want to return multiple values, but not a set, only a single row, from a plpgsql function and I can't seem to get it to work. (I suppose I'd be happy to return a set, but I can't seem to make that work either. Anyway, what's wrong with this?) Version is: $ rpm -q postgresql
6
1714
by: groups.20.thebriguy | last post by:
I've noticed that there's a few functions that return what appears to be a tuple, but that also has attributes for each item in the tuple. For example, time.localtime() returns a time.time_struct, which looks like a tuple but also like a struct. That is, I can do: >>> time.localtime() (2006, 1, 18, 21, 15, 11, 2, 18, 0) >>> time.localtime() 21 >>> time.localtime().tm_hour
1
11722
by: eros | last post by:
CREATE OR REPLACE FUNCTION f_customerlogininfo(varchar, varchar, varchar) RETURNS public.v_customerlogininfo AS ' DECLARE p_schm ALIAS FOR $1; p_contact ALIAS FOR $2; p_status ALIAS FOR $3; v_boolstatus boolean; BEGIN IF p_status = ''all'' THEN RETURN (select * from v_customerlogininfo where contact = p_contact); ELSE
7
6801
by: Terry Carroll | last post by:
I'm trying to use wx.ProgressBar, and the cancel button is not responding. Here is a simple program that exhibits the problem: ######################################################### import wx import time max = 10
2
2176
by: satyanarayan sahoo | last post by:
Can we write a method which returns multiple values?
0
8474
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8392
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8912
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8669
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4403
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2809
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.