Re: [Tutor] unwanted 'zero' ending

2013-06-27 Thread Steven D'Aprano
On 28/06/13 11:32, Jim Mooney wrote: On 27 June 2013 17:05, Dave Angel Nope. it is limited to the tests you write. And those tests are necessarily fairly simple. Hmm, so it seems a lot of trouble for a few hardcoded tests I could run myself from the IDE interpreter window. Or better yet,

Re: [Tutor] unwanted 'zero' ending

2013-06-27 Thread Dave Angel
On 06/27/2013 09:32 PM, Jim Mooney wrote: On 27 June 2013 17:05, Dave Angel Nope. it is limited to the tests you write. And those tests are necessarily fairly simple. Hmm, so it seems a lot of trouble for a few hardcoded tests I could run myself from the IDE interpreter window. NO. You

Re: [Tutor] python / gtk / Webkit app wrapper.

2013-06-27 Thread Darin Lawson Hosking
Thank you both for the response Alan - This is my first python program (actually first anything, besides simple one line shell scripts) and if I broke protocol I do apologize. eryksun - that did it after pulling out the indention after I copy pasted :) BUT it is missing the (right click suggested

Re: [Tutor] unwanted 'zero' ending

2013-06-27 Thread Dave Angel
On 06/27/2013 07:39 PM, Jim Mooney wrote: On 27 June 2013 05:38, Steven D'Aprano wrote: Unit tests are great, but the learning curve is rather steep. I recommend that you start with doctests. I tried a simple one and it worked, but a puzzlement. Does it Only test what you've hard-coded? P

Re: [Tutor] python / gtk / Webkit app wrapper.

2013-06-27 Thread Alan Gauld
On 27/06/13 22:57, Darin Lawson Hosking wrote: Greetings all, Was wondering if one of you fine python wizards could help me with trying to fix a python / gtk / Webkit app wrapper. This list is for people learning the Python language and its standard library. For info on GTk and Webkit you sho

[Tutor] python / gtk / Webkit app wrapper.

2013-06-27 Thread Darin Lawson Hosking
Greetings all, Was wondering if one of you fine python wizards could help me with trying to fix a python / gtk / Webkit app wrapper. Here is a simple version of what I am trying to do. http://pastebin.com/2zi0SgfT The HUGE hurdle I am having is activating the Webkit spell checker for forms. f

Re: [Tutor] Need help appending data to a logfile

2013-06-27 Thread Dave Angel
On 06/27/2013 05:09 PM, Matt D wrote: On 06/27/2013 12:54 PM, Dave Angel wrote: On 06/27/2013 12:33 PM, Matt D wrote: I forgot to mention i have the 'with open(mypath, "a") as f: commented out because it was making an indentation error that i could not fix. It was indented, and shoul

Re: [Tutor] Need help appending data to a logfile

2013-06-27 Thread Dave Angel
On 06/27/2013 12:33 PM, Matt D wrote: I forgot to mention i have the 'with open(mypath, "a") as f: commented out because it was making an indentation error that i could not fix. It was indented, and should not have been. The extra indentation FOLLOWS the with statement, it's not correc

Re: [Tutor] Need help appending data to a logfile

2013-06-27 Thread Dave Angel
On 06/27/2013 10:55 AM, Matt D wrote: On 06/27/2013 10:36 AM, Matt D wrote: You asked about a "save-as" feature. Why isn't that as simple as copying the current contents of the saved csv file? Or do you not know how you would go about copying? Hi. So I have the logger working, meaning t

Re: [Tutor] True to False and Other things!

2013-06-27 Thread Dave Angel
On 06/27/2013 09:27 AM, Jack Little wrote: In my game, I am trying to make it so when the enemy's health equals 0, the player advances. I used a while statement and a true or false variable. When the enemy health is less than or equal to 0, the program exits the while statement. It does not wo

[Tutor] True to False and Other things!

2013-06-27 Thread Jack Little
In my game, I am trying to make it so when the enemy's health equals 0, the player advances. I used a while statement and a true or false variable. When the enemy health is less than or equal to 0, the program exits the while statement. It does not work. It keeps going. How could I fix this? ___

Re: [Tutor] unwanted 'zero' ending

2013-06-27 Thread Steven D'Aprano
On 27/06/13 18:30, Peter Otten wrote: Jim Mooney wrote: On 27 June 2013 00:43, Alan Gauld wrote: Take the constant definitions out of the function Since the program has an error And needs simplification (no doubt interdependent), but it would be hard to do both at once, this brings up a

Re: [Tutor] unwanted 'zero' ending

2013-06-27 Thread ALAN GAULD
> Since the program has an error And needs simplification (no doubt > interdependent), but it would be hard to do both at once, this brings > up a good general question: Is it best, in such cases, to correct the > error, then simplify, or simplify, then correct the error? In general I'd simplify f

Re: [Tutor] unwanted 'zero' ending

2013-06-27 Thread ALAN GAULD
> > TKinter *is* Python's standard GUI toolkit. > > What do you mean? > > I just meant, how many characters are allowed on the input screen you > normally get when you put  input() in a program,  There is no "input screen" in normal use, it appears on stdout in  the console. How are you running

Re: [Tutor] unwanted 'zero' ending

2013-06-27 Thread Alan Gauld
On 27/06/13 07:40, Jim Mooney wrote: I've been staring at this program for hours, I'm not surprised. It's very cluttered. Take the constant definitions out of the function. Take the internal function out of the function. Create a few more helper functions and then get rid of the "helpful comme