Re: [Tutor] Distutils Font Error

2011-04-18 Thread Marc Tompkins
On Mon, Apr 18, 2011 at 9:57 PM, Greg Nielsen wrote: > Dear Fellow Python Users, > > I am currently working on a small Python 3.1.3 game on a Windows 7 > machine and am attempting to freezing it using Distutils and cx_freeze so I > can share it with friends and family. Several attempts in I r

[Tutor] Distutils Font Error

2011-04-18 Thread Greg Nielsen
Dear Fellow Python Users, I am currently working on a small Python 3.1.3 game on a Windows 7 machine and am attempting to freezing it using Distutils and cx_freeze so I can share it with friends and family. Several attempts in I reached an error that I am unable to fix and was hoping for some

Re: [Tutor] working with strings in python3

2011-04-18 Thread Marc Tompkins
On Mon, Apr 18, 2011 at 6:53 PM, Rance Hall wrote: > I'm going to go ahead and use this format even though it is deprecated > and then later when we upgrade it I can fix it. > > And there you have your answer. A list might make sense, but printing a message one word at a time > doesn't seem to

Re: [Tutor] working with strings in python3

2011-04-18 Thread Rance Hall
On Mon, Apr 18, 2011 at 8:10 PM, Marc Tompkins wrote: > On Mon, Apr 18, 2011 at 5:17 PM, Rance Hall wrote: >> >> Ok so I know what I am doing is deprecated (or at least poor form) but >> the replacement must be awkward cause I'm not getting it. >> >> >> so this is in a cli based program designed

Re: [Tutor] First Game Attempt

2011-04-18 Thread R. Alan Monroe
> I was reading Pygame API for a month and made out a very basic ,small game > named as "Hungry Snake" as practice. Not bad! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/t

Re: [Tutor] working with strings in python3

2011-04-18 Thread Marc Tompkins
On Mon, Apr 18, 2011 at 5:17 PM, Rance Hall wrote: > Ok so I know what I am doing is deprecated (or at least poor form) but > the replacement must be awkward cause I'm not getting it. > > > so this is in a cli based program designed to print status messages to > the terminal on a linux box. > > p

Re: [Tutor] working with strings in python3

2011-04-18 Thread tktucker
Your code worked fine for me. Is it possible your "test" variable wasn't true? message = "Bah." message = message + " Humbug!" print(message) Bah. Humbug! On Apr 18, 2011 8:17pm, Rance Hall wrote: Ok so I know what I am doing is deprecated (or at least poor form) but the replacem

Re: [Tutor] working with strings in python3

2011-04-18 Thread James Mills
On Tue, Apr 19, 2011 at 10:34 AM, James Mills wrote: > Normally it's considered bad practise to concatenate strings. > Use a a format specifier like this: > >> message = "Bah." >> >> if test: >>   message = "%s %s" (message, " Humbug!") >> >> print(message) > > Python3 (afaik) also introduced the

Re: [Tutor] working with strings in python3

2011-04-18 Thread Steve Willoughby
On 18-Apr-11 17:17, Rance Hall wrote: if test: message = message + " Humbug!" I'm sure this is not the way we are supposed to augment strings like this. maybe there is string.append() method or something I should be using instead? Nope, strings are immutable so once they are instantiate

[Tutor] working with strings in python3

2011-04-18 Thread Rance Hall
Ok so I know what I am doing is deprecated (or at least poor form) but the replacement must be awkward cause I'm not getting it. so this is in a cli based program designed to print status messages to the terminal on a linux box. pseudo code: message = "Bah." if test: message = message + "

[Tutor] First Game Attempt

2011-04-18 Thread ANKUR AGGARWAL
Hey I was reading Pygame API for a month and made out a very basic ,small game named as "Hungry Snake" as practice. Want to share out the code with uou guys. Here's the link http://code.google.com/p/hungry-snakes/downloads/list Thanks Ankur Aggarwal ___ T

Re: [Tutor] wxPython issues

2011-04-18 Thread Alan Gauld
"Eric Stevens" wrote prototype pages. Right now, I am trying to create a wx.ScrolledWindow class I would strongly recommend not calling your class the same as the standard widget. I don't think thats causing issues here but I wouldn't be surprised! Its a bit like overrriding built-in Python

[Tutor] wxPython issues

2011-04-18 Thread Eric Stevens
I am trying to create an addressbook program and am currently working on prototype pages. Right now, I am trying to create a wx.ScrolledWindow class with a wx.ListCtrl to display the names of all contacts. I keep running into an error with my current configuration that is stating I have not specif

Re: [Tutor] Trouble executing an if statement with a string fromaninput

2011-04-18 Thread Alan Gauld
"Peter Otten" <__pete...@web.de> wrote x = input("a, b, or c:") ... If she were using 2.x and typed an 'a' she would get a NameError. Oops, too early in the morning. For some reason I thought she was using numbers... Doh! If you want your code to work in both Python versions you could e

Re: [Tutor] Trouble executing an if statement with a string from aninput

2011-04-18 Thread Peter Otten
Alan Gauld wrote: > > "Sylvia DeAguiar" wrote > >> The code runs fine on python shell (from run module) but >> when I try to execute the program from its file, it always >> prints out c, regardless > >> x = input("a, b, or c:") >> ... >> else: >> print ('c') > > It looks like IDLE is runn

Re: [Tutor] Trouble executing an if statement with a string from aninput

2011-04-18 Thread Alan Gauld
"Sylvia DeAguiar" wrote The code runs fine on python shell (from run module) but when I try to execute the program from its file, it always prints out c, regardless x = input("a, b, or c:") ... else: print ('c') It looks like IDLE is running Python V3 where as the shell is picking u

Re: [Tutor] Trouble executing an if statement with a string from an input

2011-04-18 Thread Timo
On 18-04-11 05:11, Sylvia DeAguiar wrote: The code runs fine on python shell (from run module) but when I try to execute the program from its file, it always prints out c, regardless of the input. What is wrong? Thanks for any help :) x = input("a, b, or c:") Enter a debug print statement

[Tutor] Trouble executing an if statement with a string from an input

2011-04-18 Thread Sylvia DeAguiar
The code runs fine on python shell (from run module) but when I try to execute the program from its file, it always prints out c, regardless of the input. What is wrong? Thanks for any help :)   x = input("a, b, or c:") if x == "a":     print ("a") elif x == "b":     print ("b") else: