Re: [Tutor] First program after PyCamp

2013-06-12 Thread Chris Calloway
On 6/12/2013 11:18 AM, bja...@jamesgang.dyndns.org wrote: I've updated this code and to make it more easily readible put it in a github repo https://github.com/CyberCowboy/FindDuplicates Everything is working, however the code is hard to read and I'll be working on cleaning that up, as well as s

Re: [Tutor] First program after PyCamp

2013-06-12 Thread bjames
I've updated this code and to make it more easily readible put it in a github repo https://github.com/CyberCowboy/FindDuplicates Everything is working, however the code is hard to read and I'll be working on cleaning that up, as well as splitting the program into 3 different functions (one that ge

Re: [Tutor] First program after PyCamp

2013-06-12 Thread bjames
I've updated this code and to make it more easily readible put it in a github repo https://github.com/CyberCowboy/FindDuplicates Everything is working, however the code is hard to read and I'll be working on cleaning that up, as well as splitting the program into 3 different functions (one that ge

Re: [Tutor] First program after PyCamp

2013-06-10 Thread Dave Angel
On 06/10/2013 04:03 PM, bja...@jamesgang.dyndns.org wrote: Hello I just took a 3 day PyCamp and am working on my first program from start to finish at the moment and running into a problem. Not sure how it's supposed to be on this list Please start by defining your version of Python. I'm goin

Re: [Tutor] First program after PyCamp

2013-06-10 Thread bjames
Thank you for your quick response Dave. I found out after I submitted my code here that it does in fact work now. I had spent several interupted hours trying to get it to work and must have changed something and forgotten about the change before submitting it here. I appreciate your suggestions

Re: [Tutor] First program after PyCamp

2013-06-10 Thread bjames
Walter, Thanks for the quick reply, I mentioned to Dave Angel that when I was working on it I spent a few interrupted hours working on it (at work, people asking for things distracted me) and the problem I mentioned WAS happening on small test cases, but yes when I run the code I actually submitte

Re: [Tutor] First program after PyCamp

2013-06-10 Thread Alan Gauld
On 10/06/13 23:21, bja...@jamesgang.dyndns.org wrote: suggestions and plan to incorporate at least some of them to make the code better (I understand it's not pythonic method change it once it's working 'well enough' but I'm going to for the learning experience. There is nothing unpythonic abo

Re: [Tutor] First program after PyCamp

2013-06-10 Thread Walter Prins
Hi Bryan, On 10 June 2013 21:03, wrote: > My problem is the text file that is output seems to contain EVERY file > that the program went through rather than just the duplicates. > "Seems" does not sound very certain... have you double checked whether your suspicion is in fact correct? E.g. hav

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Ken G. wrote: I am using Ubuntu 9.04 and I have versions 2.6.2 and 3.0.1+ installed. Look for IDLE in Add/Remove Applications. Perhaps, you may have a different version of Ubuntu. Ken Ray Parrish wrote: Yes, I'm using 2.45.2 as that is the highest version available in the Ubuntu repositorie

Re: [Tutor] First program

2010-03-13 Thread Luke Paireepinart
On Sat, Mar 13, 2010 at 12:04 PM, Ray Parrish wrote: > Luke Paireepinart wrote: > >> >> Your version creates at least 10 intermediate strings before outputting. >> Remember strings are immutable in Python. So you're constructing strings >> The area of a >> The area of a rectangle >> The area of a

Re: [Tutor] First program

2010-03-13 Thread Ken G.
I am using Ubuntu 9.04 and I have versions 2.6.2 and 3.0.1+ installed. Look for IDLE in Add/Remove Applications. Perhaps, you may have a different version of Ubuntu. Ken Ray Parrish wrote: Yes, I'm using 2.45.2 as that is the highest version available in the Ubuntu repositories, and I'd l

Re: [Tutor] First program

2010-03-13 Thread Alan Gauld
"Ray Parrish" wrote As far as the capitalizations, it's just a habit I've held over from my Visual Basic days, and earlier programming. It's a little easier for me to pick out the individual words in a variable like ThisPerson as opposed to thisperson. thisPerson is fine for a variable

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Andre Engels wrote: On Sat, Mar 13, 2010 at 3:11 AM, Ray Parrish wrote: Andre Engels wrote: On 3/12/10, yd wrote: else: raise Exception('{0}, is not a valid choice'.format(choice)) This will cause the program to stop-with-error if something wrong is entered. I t

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Luke Paireepinart wrote: Ray, please reply on-list in the future in case someone else has input. On Fri, Mar 12, 2010 at 8:01 PM, Ray Parrish > wrote: Luke Paireepinart wrote: print "A %s with dimensions %sx%s has an area of %s." % (choice, height,

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Luke Paireepinart wrote: On Sat, Mar 13, 2010 at 3:03 AM, Alan Gauld > wrote: "Ray Parrish" mailto:c...@cmc.net>> wrote print "A %s with dimensions %sx%s has an area of %s." % (choice, height, width, width*height) Isn'

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Alan Gauld wrote: "Ray Parrish" wrote print "A %s with dimensions %sx%s has an area of %s." % (choice, height, width, width*height) Isn't it a little more understandable to use a construct like the following? print "The area of a " + Choice + "is " str(Width) + " x " + str(Height) +

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Steven D'Aprano wrote: On Sat, 13 Mar 2010 01:04:42 pm Ray Parrish wrote: print "A %s with dimensions %sx%s has an area of %s." % (choice, height, width, width*height) Hello, Isn't it a little more understandable to use a construct like the following? print "The area of a

Re: [Tutor] First program

2010-03-13 Thread Alan Gauld
"Luke Paireepinart" wrote print "The area of a " + Choice + "is " str(Width) + " x " + str(Height) + " equals " + str(Width * Height) + " square feet" One thing - you don't need all the str() calls in your example, print already calls str() for you. Also comma separators are bett

Re: [Tutor] First program

2010-03-13 Thread yd
Thanks everyone, I am trying to figure out functions and classes right now, i will probably rewrite the program once i get that down and probably use try: and except: for error catching. ___ Tutor maillist - Tutor@python.org To unsubscribe or change sub

Re: [Tutor] First program

2010-03-13 Thread Luke Paireepinart
On Sat, Mar 13, 2010 at 3:03 AM, Alan Gauld wrote: > "Ray Parrish" wrote > >>print "A %s with dimensions %sx%s has an area of %s." % (choice, >>> height, width, width*height) >>> >>> Isn't it a little more understandable to use a construct like the >> following? >> >> print "The area of a "

Re: [Tutor] First program

2010-03-13 Thread Alan Gauld
"Ray Parrish" wrote print "A %s with dimensions %sx%s has an area of %s." % (choice, height, width, width*height) Isn't it a little more understandable to use a construct like the following? print "The area of a " + Choice + "is " str(Width) + " x " + str(Height) + " equals " + str(Wi

Re: [Tutor] First program

2010-03-12 Thread Steven D'Aprano
On Sat, 13 Mar 2010 01:04:42 pm Ray Parrish wrote: > >     print "A %s with dimensions %sx%s has an area of %s." % > > (choice, height, width, width*height) > > Hello, > > Isn't it a little more understandable to use a > construct like the following? > > >>> print "The area of a " + Choice + "is "

Re: [Tutor] First program

2010-03-12 Thread Steven D'Aprano
On Sat, 13 Mar 2010 01:11:25 pm Ray Parrish wrote: > Here's what I get from that, could you please explain why? > >  >>> print('{0}, is not a valid choice'.format(choice)) > Traceback (most recent call last): >   File "", line 1, in > AttributeError: 'str' object has no attribute 'format' The ori

Re: [Tutor] First program

2010-03-12 Thread Luke Paireepinart
On Fri, Mar 12, 2010 at 8:30 PM, Andre Engels wrote: > On Sat, Mar 13, 2010 at 3:11 AM, Ray Parrish wrote: > > Andre Engels wrote: > >> > >> On 3/12/10, yd wrote: > >>> else: > >>>raise Exception('{0}, is not a valid choice'.format(choice)) > >>> > >> > >> This will cause the program to st

Re: [Tutor] First program

2010-03-12 Thread Luke Paireepinart
Ray, please reply on-list in the future in case someone else has input. On Fri, Mar 12, 2010 at 8:01 PM, Ray Parrish wrote: > Luke Paireepinart wrote: > >print "A %s with dimensions %sx%s has an area of %s." % (choice, height, >> width, width*height) >> >> > Isn't it a little more understand

Re: [Tutor] First program

2010-03-12 Thread Andre Engels
On Sat, Mar 13, 2010 at 3:11 AM, Ray Parrish wrote: > Andre Engels wrote: >> >> On 3/12/10, yd wrote: >>>  else: >>>    raise Exception('{0}, is not a valid choice'.format(choice)) >>> >> >> This will cause the program to stop-with-error if something wrong is >> entered. I think that's quite rude

Re: [Tutor] First program

2010-03-12 Thread Ray Parrish
Luke Paireepinart wrote: On Fri, Mar 12, 2010 at 4:03 AM, yd > wrote: Hi, I am new to programming, altough i have read a few books about OOP and O'Reily's Learning Python. I would like some critique on my first program, is it normal for it to be t

Re: [Tutor] First program

2010-03-12 Thread Ray Parrish
Andre Engels wrote: On 3/12/10, yd wrote: Hi, I am new to programming, altough i have read a few books about OOP and O'Reily's Learning Python. I would like some critique on my first program, is it normal for it to be this long to do something simple? Well, many of your lines are user

Re: [Tutor] First program

2010-03-12 Thread Alan Gauld
"yd" wrote I would like some critique on my first program, is it normal for it to be this long to do something simple? Its OK for a first program. There are many things that could be improved but its not too bad. As to length, it could be shortened a bit but this is not really a long progr

Re: [Tutor] First program

2010-03-12 Thread Andre Engels
On 3/12/10, yd wrote: > Hi, > I am new to programming, altough i have read a few books about OOP and > O'Reily's Learning Python. > I would like some critique on my first program, is it normal for it to be > this long to do something simple? Well, many of your lines are user interface. Writing tw

Re: [Tutor] First program

2010-03-12 Thread Luke Paireepinart
On Fri, Mar 12, 2010 at 4:03 AM, yd wrote: > Hi, > I am new to programming, altough i have read a few books about OOP and > O'Reily's Learning Python. > I would like some critique on my first program, is it normal for it to be > this long to do something simple? > I know i could have turned some

Re: [Tutor] First program -- would like comments and criticisms

2006-02-20 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Here is my first stab at putting together a working program. It is a > glossary that you can add words and definitions to, or look up words and > their definitions. There are a couple of problems here and there, but > it basically does what I set out for it to do. All

Re: [Tutor] First program -- would like comments and criticisms

2006-02-19 Thread benmarkwell
Thanks Andrei for your input.I've already implemented a couple of your suggestions and will certainlygive the others a go. On 2/18/06, Andrei <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote:> Here is my first stab at putting together a working program. It is a> glossary that you can add words a

Re: [Tutor] First program -- would like comments and criticisms

2006-02-18 Thread Andrei
[EMAIL PROTECTED] wrote: > Here is my first stab at putting together a working program. It is a > glossary that you can add words and definitions to, or look up words and > their definitions. There are a couple of problems here and there, but > it basically does what I set out for it to do. All