Re: [Tutor] Handling Objects

2005-10-05 Thread Andrew P
To do: $color = "Green"; print "$color apple.\n"; You would want: color = "Green" print "%s apple." % color Both of which would print "Green apple."  That is actually something I like about Perl, but it reinforces some bad habits, at least for me.  Boilerplate coding, as it were, when doing qui

Re: [Tutor] Handling Objects

2005-10-05 Thread Eric Walker
Thanks Kent.. I think that would work for what I am doing. So is it safe to say that python doesn't do variable interpolation like perl..? Thanks in advance. Python Newbie... On Wednesday 05 October 2005 05:20 pm, Kent Johnson wrote: > Eric Walker wrote: > > Well, > > I think I probably can do

Re: [Tutor] Handling Objects

2005-10-05 Thread Kent Johnson
Eric Walker wrote: > Thanks Kent.. I think that would work for what I am doing. So is it safe to > say that python doesn't do variable interpolation like perl..? I think so, though I don't really speak perl. The closest approximation is the string formatting operation and the string.Template cla

Re: [Tutor] Handling Objects

2005-10-05 Thread Kent Johnson
Eric Walker wrote: > Well, > I think I probably can do this easier in perl but I took a vow I would try > and > learn python. I know I am using classes here and really don't need objects. > This is just another way for me to learn how to work with classes within > python. My object actually wi

Re: [Tutor] Handling Objects

2005-10-05 Thread Eric Walker
Well, I think I probably can do this easier in perl but I took a vow I would try and learn python. I know I am using classes here and really don't need objects. This is just another way for me to learn how to work with classes within python. My object actually will be storing like 5 or 6 differ

Re: [Tutor] Handling Objects

2005-10-05 Thread Kent Johnson
Eric Walker wrote: > New to Python and trying to do some class stuff with a simple task. > Problem: > 1) get a list of file names in a directory > 2) create variables with the same name of each filename pulled from the > directory. > 3) Create an object for each and pass into the __init__ method