[Tutor] QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-26 Thread Sunitha Misra
tutor@python.org Hello, I am trying to write a UI for my utility, using QT-Python. I first launch a GUI and click on a toolButton to open up the directory structure, from which I select a particular file. self.fileDialog = QtGui.QFileDialog() QtCore.QObject.connect(self.toolButton, QtCore.SIGNAL

Re: [Tutor] making a string

2013-05-26 Thread Steven D'Aprano
On 27/05/13 10:43, Jim Mooney wrote: On 26 May 2013 17:38, eryksun wrote: On Sun, May 26, 2013 at 8:20 PM, Steven D'Aprano wrote: On 27/05/13 07:40, Jim Mooney wrote: Good to know that compile doesn't check syntax, since I erroneously thought it did. compile does check syntax. Attemptin

Re: [Tutor] keyboard interrupt

2013-05-26 Thread Jim Mooney
>> Bad programming advice is bad enough, but putting up bad advice to >> edit the Windows registry is Really, Really bad. > > Did you leave a comment with the correction? Good point. I wasn't registered on that board but I should go find it. Not that the mistype in that case could possibly cause a

Re: [Tutor] making a string

2013-05-26 Thread Jim Mooney
On 26 May 2013 17:38, eryksun wrote: > On Sun, May 26, 2013 at 8:20 PM, Steven D'Aprano wrote: >> On 27/05/13 07:40, Jim Mooney wrote: >> >>> Good to know that compile doesn't check syntax, since I erroneously >>> thought it did. >> >> compile does check syntax. > > Attempting to iterate an integ

Re: [Tutor] making a string

2013-05-26 Thread eryksun
On Sun, May 26, 2013 at 8:20 PM, Steven D'Aprano wrote: > On 27/05/13 07:40, Jim Mooney wrote: > >> Good to know that compile doesn't check syntax, since I erroneously >> thought it did. > > compile does check syntax. Attempting to iterate an integer is a runtime TypeError, not a compile-time Syn

Re: [Tutor] making a string

2013-05-26 Thread Jim Mooney
On 26 May 2013 17:20, Steven D'Aprano wrote: > On 27/05/13 07:40, Jim Mooney wrote: > >> Good to know that compile doesn't check syntax, since I erroneously >> thought it did. > > > compile does check syntax. I'm unclear on something. The code below creates bytecode and I don't see an error messa

Re: [Tutor] keyboard interrupt

2013-05-26 Thread eryksun
On Sun, May 26, 2013 at 8:25 PM, Jim Mooney wrote: > > StackOverflow may be good but I just had an unpleasant experience > wanting to add New .py file to my Windows context menu. The first > advice I saw was missing a backslash and had me adding the string to > the wrong key. Thankfully, it didn't

Re: [Tutor] keyboard interrupt

2013-05-26 Thread Jim Mooney
On 26 May 2013 15:33, Marc Tompkins wrote: > On Sun, May 26, 2013 at 6:17 AM, eryksun wrote: StackOverflow may be good but I just had an unpleasant experience wanting to add New .py file to my Windows context menu. The first advice I saw was missing a backslash and had me adding the string to th

Re: [Tutor] making a string

2013-05-26 Thread Steven D'Aprano
On 27/05/13 07:40, Jim Mooney wrote: Good to know that compile doesn't check syntax, since I erroneously thought it did. compile does check syntax. py> compile("23 = 43", "", "exec") Traceback (most recent call last): File "", line 1, in File "", line 1 SyntaxError: can't assign to lite

Re: [Tutor] keyboard interrupt

2013-05-26 Thread Marc Tompkins
On Sun, May 26, 2013 at 6:17 AM, eryksun wrote: > On Sun, May 26, 2013 at 4:34 AM, Steven D'Aprano > wrote: > > > > So these edits aren't default-deny, but default-accept? Worse and worse. > > It shows who made the edit and when they edited it, which links to the > revision history. When a quest

Re: [Tutor] making a string

2013-05-26 Thread Mark Lawrence
On 26/05/2013 22:40, Jim Mooney wrote: On 26 May 2013 02:51, Mark Lawrence wrote: Basically no. Python 2.7 is guaranteed to be backward compatible with Python 2.6. New or improved functionality will be listed in the "What's New for Python 2.7". In fact if you look at the "What's New for Pyth

Re: [Tutor] making a string

2013-05-26 Thread Jim Mooney
On 26 May 2013 02:51, Mark Lawrence wrote: > Basically no. Python 2.7 is guaranteed to be backward compatible with > Python 2.6. New or improved functionality will be listed in the "What's New > for Python 2.7". In fact if you look at the "What's New for Python 3.3" > you'll find all of the "Wh

Re: [Tutor] keyboard interrupt

2013-05-26 Thread eryksun
On Sun, May 26, 2013 at 4:34 AM, Steven D'Aprano wrote: > > So these edits aren't default-deny, but default-accept? Worse and worse. It shows who made the edit and when they edited it, which links to the revision history. When a question is closed it shows who voted to close it. Even retagging sh

Re: [Tutor] making a string

2013-05-26 Thread Mark Lawrence
On 26/05/2013 05:10, Jim Mooney wrote: On 25 May 2013 20:49, Tim Hanson wrote: A lot of people tend to be intimidated by Mark Lutz, and so am I, I guess. Interesting coincidence. This is a retirement project and I just decided on the Lutz book, which looked comprehensive, since the book I'm

Re: [Tutor] Flip the coin 10x and count heads and tails: It works now!

2013-05-26 Thread Todd Matsumoto
May I suggest running randint using 0, 1. The results can be tested like a boolean. See what happens when you do an if test on 1 versus an if test on 0. Also perhaps store your results in a dictionary with 'heads', 'tails' each value set to 0. On Sat, May 25, 2013 at 3:13 PM, Steven D'Aprano wro

Re: [Tutor] keyboard interrupt

2013-05-26 Thread Steven D'Aprano
On 26/05/13 17:57, Marc Tompkins wrote: On Fri, May 24, 2013 at 7:19 PM, Steven D'Aprano wrote: You can edit *other* people's questions and answers??!??!?? What. The. Hell. The idea is to build an authoritative information resource (in particular, the goal is that the accepted answer to any

Re: [Tutor] Fwd: Difference between types

2013-05-26 Thread Steven D'Aprano
On 25/05/13 02:52, Citizen Kant wrote: When I say "coding", anyone can think about what coding is in his own daily work, but that's not my way. I'll try to refine the concept: right now I'm learning, if I say "coding" I refer to what I type inside my file named learningpythoncode.py that, believe

Re: [Tutor] keyboard interrupt

2013-05-26 Thread Marc Tompkins
On Fri, May 24, 2013 at 7:19 PM, Steven D'Aprano wrote: You can edit *other* people's questions and answers??!??!?? > > What. The. Hell. The idea is to build an authoritative information resource (in particular, the goal is that the accepted answer to any given question will become the primary r