Re: [Tutor] How to examine the following problem

2012-04-19 Thread Alan Gauld
On 19/04/12 04:11, lina wrote: I meet a problem, mainly some error waring: CmdException Exception in Tk callback Function: at 0x46fdde8> (type: ) Args: () Traceback (innermost last): File "/usr/lib/python2.7/dist-packages/Pmw/Pmw_1_3/lib/PmwBase.py", line This tells us the problem originates

Re: [Tutor] How to examine the following problem

2012-04-19 Thread lina
On Thursday 19,April,2012 03:27 PM, Alan Gauld wrote: On 19/04/12 04:11, lina wrote: I meet a problem, mainly some error waring: CmdException Exception in Tk callback Function: at 0x46fdde8> (type: ) Args: () Traceback (innermost last): File "/usr/lib/python2.7/dist-packages/Pmw/Pmw_1_3/lib/P

[Tutor] how to select a player to play first on a multiplayer game which runs on IRC

2012-04-19 Thread Surya K
I am writing tic tac toe game which runs on IRC (i am using freenode now). Each player will be a channel member. So, players send private messages between each other to play game. This sounds fine but I need the below things to get done, but I don't know how to do them.. How my game works: Each

Re: [Tutor] how to select a player to play first on a multiplayer game which runs on IRC

2012-04-19 Thread Dave Angel
On 04/19/2012 06:54 AM, Surya K wrote: > I am writing tic tac toe game which runs on IRC (i am using freenode now). > Each player will be a channel member. So, players send private messages > between each other to play game. This sounds fine but I need the below things > to get done, but I don't

[Tutor] Readabilty vs 80 characters

2012-04-19 Thread Tino Dai
Hi! I have a question about style. In PEP-8, it says don't exceed 79 characters, but can this rule ever be trumped by readability? Eg. if someobject.filter(something) \ .filter(somethingreallyreallyreallyreallylong == somethingelsereallyreallylong) \ .filter(otheth

Re: [Tutor] how to select a player to play first on a multiplayer game which runs on IRC

2012-04-19 Thread Surya K
> Date: Thu, 19 Apr 2012 07:24:33 -0400 > From: d...@davea.name > To: sur...@live.com > CC: tutor@python.org; bgai...@gmail.com > Subject: Re: [Tutor] how to select a player to play first on a multiplayer > game which runs on IRC > > On 04/19/2012 06:54 AM, Surya K wrote: > > I am writing tic

Re: [Tutor] Readabilty vs 80 characters

2012-04-19 Thread Wayne Werner
On Thu, 19 Apr 2012, Tino Dai wrote: Hi!      I have a question about style. In PEP-8, it says don't exceed 79 characters, but can this rule ever be trumped by  readability? PEP 8 is style guidelines, not hard and fast rules or they wouls be syntax errors. But that would just be annoying, so

Re: [Tutor] Readabilty vs 80 characters

2012-04-19 Thread Prasad, Ramit
> I have a question about style. In PEP-8, it says don't exceed 79 > characters, but can this rule ever be trumped by > readability? > > Eg. > > > if someobject.filter(something) \ > .filter(somethingreallyreallyreallyreallylong == > somethingelsereallyreallylong) \ >

Re: [Tutor] Readabilty vs 80 characters

2012-04-19 Thread Evert Rol
On 19 Apr, 2012, at 15:29 , Tino Dai wrote: > Hi! > > I have a question about style. In PEP-8, it says don't exceed 79 > characters, but can this rule ever be trumped by > readability? > Yes, it obviously can. I am a big fan of the 79 character "rule", though. Even with screens and ter

Re: [Tutor] Readabilty vs 80 characters

2012-04-19 Thread Peter Otten
Tino Dai wrote: > Hi! > > I have a question about style. In PEP-8, it says don't exceed 79 > characters, but can this rule ever be trumped by > readability? > > Eg. > > > if someobject.filter(something) \ > .filter(somethingreallyreallyreallyreallylong == > somethingelserea

[Tutor] How to run a small python client-server on Google App Engine

2012-04-19 Thread Surya K
I wrote a small python Client-Server program.. (I use python 2.7) and want to make it real. I mean, I want to put the server on Google App Engine.. I went through it and found that, I need to use Google API so that it should work on GAE. So, How could I create such a small Google App Engine's a

Re: [Tutor] How to run a small python client-server on Google App Engine

2012-04-19 Thread ian douglas
I suppose you could run something persistent on a reserved instance at Google App Engine, but typically they kill any process running longer than 30 seconds. And the persistent servers aren't free. On Apr 19, 2012 7:36 AM, "Surya K" wrote: > I wrote a small python Client-Server program.. (I use

[Tutor] .py vs .pyc

2012-04-19 Thread Max S.
Could anyone tell me why I should use a .pyc file rather than a .py? After doing some research, I have found that a .py file is first precompiled and then run, while a .pyc file is already precompiled and is simply run. But unless I'm mistaken, it seems that a .pyc is no faster or better than a .

Re: [Tutor] .py vs .pyc

2012-04-19 Thread Max S.
Then if I understand correctly, I work with .py files and (should) run them as .pyc files? On Thu, Apr 19, 2012 at 10:55 AM, Russel Winder wrote: > On Thu, 2012-04-19 at 10:47 -0400, Max S. wrote: > > Could anyone tell me why I should use a .pyc file rather than a .py? > After > > doing some res

Re: [Tutor] .py vs .pyc

2012-04-19 Thread Russel Winder
On Thu, 2012-04-19 at 10:47 -0400, Max S. wrote: > Could anyone tell me why I should use a .pyc file rather than a .py? After > doing some research, I have found that a .py file is first precompiled and > then run, while a .pyc file is already precompiled and is simply run. But > unless I'm mista

Re: [Tutor] Readabilty vs 80 characters

2012-04-19 Thread Russel Winder
On Thu, 2012-04-19 at 16:00 +0200, Peter Otten wrote: [...] > Seriously, learn that you don't need backslashes if you put the expression > into parens, precalculate parts of the expression and put them into > temporary variables -- and if that doesn't suffice to keep the code readable > and belo

Re: [Tutor] .py vs .pyc

2012-04-19 Thread Russel Winder
On Thu, 2012-04-19 at 10:57 -0400, Max S. wrote: > Then if I understand correctly, I work with .py files and (should) run > them as .pyc files? No, you always run the py files, don't worry about the pyc files at all, the PVM will do what it does. -- Russel. ==

Re: [Tutor] Readabilty vs 80 characters

2012-04-19 Thread Emile van Sebille
On 4/19/2012 6:29 AM Tino Dai said... Hi! I have a question about style. In PEP-8, it says don't exceed 79 characters, but can this rule ever be trumped by readability? It's trumped by something: >>> for ii in range(10): ... D="*/"*ii+"*.py" ... L=glob.glob(D) ... for pypgm

Re: [Tutor] .py vs .pyc

2012-04-19 Thread Alan Gauld
On 19/04/12 15:47, Max S. wrote: Could anyone tell me why I should use a .pyc file rather than a .py? You don't, python handles that for you. They only come into effect on import statement. When Python imports the module it will use the pyc if available (and more recent that the .py). Don't t

Re: [Tutor] how to select a player to play first on a multiplayer game which runs on IRC

2012-04-19 Thread Alan Gauld
On 19/04/12 14:41, Surya K wrote: Rather that doing all this mess, I want to put a server on Google App Engine and run clients on my PC. But I don't know how!! Neither do I, nor I suspect most folks on this list. But there might be a few who do. The list is for learning the core Python langua

[Tutor] RuntimeError: maximum recursion depth exceeded

2012-04-19 Thread James Stauble
I have seen in a few places where this means my program is essentially in an endless loop, but as far as I can see it is formatted correctly. Any help would be greatly appreciated. Thanks in advance. #This function defines the main calls in this program def main(): mealPrice = getMeal() #c

Re: [Tutor] RuntimeError: maximum recursion depth exceeded

2012-04-19 Thread Andreas Perstinger
On 2012-04-19 21:51, James Stauble wrote: I have seen in a few places where this means my program is essentially in an endless loop, but as far as I can see it is formatted correctly. Any help would be greatly appreciated. Thanks in advance. [snip] #This function gets the tip which will be ad

Re: [Tutor] RuntimeError: maximum recursion depth exceeded

2012-04-19 Thread Alan Gauld
On 19/04/12 20:51, James Stauble wrote: I have seen in a few places where this means my program is essentially in an endless loop, Yes same here. Its not necessarily an endless loop it may just be processing more items that Pythons call stack can hamndle, but in this case it is endless. #T

[Tutor] Thanks Everyone!!!

2012-04-19 Thread James Stauble
Thanks for the tips everyone! I am fairly new to programming and am finding myself both bewildered and amazed. Its fun when it works, but boy oh boy, when it doesn't Anyway thanks again, you all have been very helpful. [?] <<330.gif>>___ Tutor maillis