Re: [Tutor] Question related to Tkinker

2011-07-24 Thread Corey Richardson
Excerpts from Emeka's message of Sun Jul 24 02:56:02 -0400 2011: > Hello All, > > I am putting up a simple game .. the game is about manipulation. If the gets > through level one ... I have to change the word with another... > > Am I going to destroy level window and build level 2 or is there a w

Re: [Tutor] Don't understand this class/constructor call syntax

2011-07-24 Thread Steven D'Aprano
dave wrote: Thank you for the two explanations. I think I have a good idea of what is going on now with the arguments and keyword arguments. My only remaining question is the pad_for_usrp argument. The default value is True so I thought it was a boolean and couldn't have anything to do with th

Re: [Tutor] Question related to Tkinker

2011-07-24 Thread Emeka
for i,cha in enumerate(wordi): label = Label(root, image=photoimage, text = cha) label.grid(row=1, column=i, columnspan=1, rowspan=1,sticky=W+E+N+S, padx=0, pady=1) label1 = Label(root, image=IMAGE) I used grid ... Though I used labels, I was dealing only on character level. So for

Re: [Tutor] Question related to Tkinker

2011-07-24 Thread Peter Otten
Emeka wrote: > for i,cha in enumerate(wordi): > > label = Label(root, image=photoimage, text = cha) > label.grid(row=1, column=i, columnspan=1, rowspan=1,sticky=W+E+N+S, > padx=0, pady=1) > label1 = Label(root, image=IMAGE) > > I used grid ... Though I used labels, I was dealing on

Re: [Tutor] Don't understand this class/constructor call syntax

2011-07-24 Thread Wayne Werner
On Sun, Jul 24, 2011 at 2:07 AM, Steven D'Aprano wrote: > (Note that among strings, only the empty string counts as nothing. The > strings 'nothing', 'empty', 'false', 'not a thing', 'nada', 'not a brass > farthing', "dry as a dingo's donger" etc. are non-empty strings and > therefore count as tru

[Tutor] Basic program question

2011-07-24 Thread Alexander Quest
Hello- I am running Python v 3.1.1. As an exercise, I wrote a simple coin flipper program, where the computer flips a coin 100 times and then prints out the number of heads and tails. My program crashes immediately if I run it normally through the command line, but if I go to "Run- Run Module," it

Re: [Tutor] Basic program question

2011-07-24 Thread Wayne Werner
On Sun, Jul 24, 2011 at 3:59 PM, Alexander Quest wrote: > My program crashes immediately if I run it normally through the command > line, Is there a traceback associated? Those usually help a lot -Wayne ___ Tutor maillist - Tutor@python.org To unsub

[Tutor] Running Python in script vs. Idle

2011-07-24 Thread brandon w
Python version 2.6.6 I wrote this in Idle and ran it in Idle and it worked fine. class ExClass: eyes = "brown" age = 99 height = '5\'11' def thisMethod(self): return 'This method works.' This is me running it in Idle. >>> ExClass ** >>> x = ExClass() >>> x.eyes *'brown'

Re: [Tutor] Basic program question

2011-07-24 Thread Steven D'Aprano
Alexander Quest wrote: Hello- I am running Python v 3.1.1. As an exercise, I wrote a simple coin flipper program, where the computer flips a coin 100 times and then prints out the number of heads and tails. My program crashes immediately if I run it normally through the command line, but if I go

Re: [Tutor] Running Python in script vs. Idle

2011-07-24 Thread Steven D'Aprano
brandon w wrote: I wrote this in Idle and ran it in Idle and it worked fine. [...] Then I try to run it from a script in Gnome-terminal and it does not run. I do not get output. I have to add print. to get any output like this: [...] What is the difference? This is what was confusing me befo

Re: [Tutor] Running Python in script vs. Idle

2011-07-24 Thread Steve Willoughby
On 24-Jul-11 16:21, brandon w wrote: Then I try to run it from a script in Gnome-terminal and it does not run. I do not get output. I have to add print. to get any output like this: When you type a Python expression at the interactive prompt in IDLE or the python command-line interpreter, it w

Re: [Tutor] Running Python in script vs. Idle

2011-07-24 Thread Steven D'Aprano
brandon w wrote: Thank you. I understand that this ( x = 1+2 ) assigns a variable to "x" and will not print in Idle, but how would I get the 'class' that I created to run from the script like it does in Idle? Will I have to put print before everything I have to print? Yes. If you want someth

Re: [Tutor] Running Python in script vs. Idle

2011-07-24 Thread brandon w
On 07/24/2011 07:59 PM, Steven D'Aprano wrote: brandon w wrote: Thank you. I understand that this ( x = 1+2 ) assigns a variable to "x" and will not print in Idle, but how would I get the 'class' that I created to run from the script like it does in Idle? Will I have to put print before every

Re: [Tutor] Don't understand this class/constructor call syntax

2011-07-24 Thread Steven D'Aprano
dave wrote: I was dimly aware of the functioning of booleans, but I see now that it doesn't specify an actual boolean type. Still, the code confuses me. Is the usage of pad_for_usrp consistent with it being treated as a boolean? Why would the entire self reference be transmitted then? Parame

Re: [Tutor] Don't understand this class/constructor call syntax

2011-07-24 Thread dave
I was dimly aware of the functioning of booleans, but I see now that it doesn't specify an actual boolean type. Still, the code confuses me. Is the usage of pad_for_usrp consistent with it being treated as a boolean? Why would the entire self reference be transmitted then? Example code again:

[Tutor] List problem

2011-07-24 Thread David Merrick
class Node: def __init__(self,initdata): self.data = initdata self.next = None def getData(self): return self.data def getNext(self): return self.next def setdata(self,newData): self.data = newData def setNext(self,newnext): sel

Re: [Tutor] List problem

2011-07-24 Thread bob gailer
I have no desire to wade through all that code. Please post the entire traceback. On 7/24/2011 10:19 PM, David Merrick wrote: class Node: def __init__(self,initdata): self.data = initdata self.next = None def getData(self): return self.data def getNext(sel

Re: [Tutor] List problem

2011-07-24 Thread Andre Engels
On Mon, Jul 25, 2011 at 4:19 AM, David Merrick wrote: > def append(self,item): > '''Adds an item to the end of the List''' > > current = self.head > previous = None > while current.getNext() != None: > previous = current > current