Re: [Tutor] intefaces in python

2009-06-28 Thread Bob Rea
On Sun June 28 2009 1:48 pm, Alan Gauld wrote:
> advantages to them over defining, say, a mixin

Noob, here, wanted to know what a mixin is
eh, just getting back into learning python
googled it, still not sure what it is, but
wikipedia says the name come from ice cream mixins at 
Steve's Ice Cream Parlor

Ah yes, i was a frequenter there

Will watch out for what it is when I get farther into python
may have to name them things like jimmies and 
heath_bar_crunch

-- 
Bob Rea
mailto:gapet...@stsams.org
http://www.petard.us
http://www.petard.us/blog
http://www.petard.us/gallery

Where is Bill Stringfellow
now that we really need him?
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Needing Help

2009-06-30 Thread Bob Rea
I am jsut beginning to learn python form a book. I have run 
into a problem running a script from the book. I want to 
ask for help. Shoudl I put the whole script into my email 
or put it somewhere on the web for you to look at instead. 
Not sure how this works, script is 68 lines.

-- 
Bob Rea
mailto:gapet...@stsams.org
http://www.petard.us
http://www.petard.us/blog
http://www.petard.us/gallery

Where is Bill Stringfellow
now that we really need him?
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] PYTHONPATH

2009-06-30 Thread Bob Rea
In working my way through the book on python, i am working 
in directories for chapers. Now I am on modules, and some 
are reused in later chapters. I have set up a directory for 
the modules. How do I add it to my PYTHONPATH?
I can use sys.path.append but that only lasts for the 
session.

-- 
Bob Rea
mailto:pet...@petard.us
http://www.petard.us
http://www.petard.us/blog
http://www.petard.us/gallery
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] PYTHONPATH-corrected

2009-06-30 Thread Bob Rea
In working my way through the book on python, I am working 
in directories for chapers. Now I am on modules, and some 
are reused in later chapters. I have set up a directory for 
the modules. How do I add it to my PYTHONPATH?
I can use sys.path.append but that only lasts for the 
session.

This is on a suse linux 10 box

-- 
Bob Rea
mailto:pet...@petard.us
http://www.petard.us
http://www.petard.us/blog
http://www.petard.us/gallery
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Needing Help

2009-06-30 Thread Bob Rea
On Tue June 30 2009 1:17 pm, vishwajeet singh 
wrote:
> You can put your script in pastebin
> http://python.pastebin.com/
> <http://python.pastebin.com/>I don't think any one will
> mind you pasting code in mail but pastebin makes it
> easier to read

I am making my way through _Making Use of Python_ by Rashi 
Gupta. I am using Python 2.4.1 

I have run into problems in a script, listed at 
http://python.pastebin.com/m51bc3388

If I input my own name and dob, it works:
b...@gandalf:~/python/MakingUse/Chapter05> python code1.py
Enter your first name:  Bob
Enter your last name:  Rea
Enter your date of birth, mm-dd-:  03-05-1943
You can chose one of the following login names:
1.   BobR
2.   BobR53
3.   RBob43
4.   BRea66

If I use the data listed in the book, it fails:
b...@gandalf:~/python/MakingUse/Chapter05> python code1.py
Enter your first name:  Laura
Enter your last name:  Jones
Enter your date of birth, mm-dd-:  12-24-1980
You can chose one of the following login names:
1.   LauraJ
2.   LauraJ2412
3.   JLaura80
Traceback (most recent call last):
  File "code1.py", line 67, in ?
fourth=fname[0]+lname+ age_func()
TypeError: cannot concatenate 'str' and 'NoneType' objects

What is going on here?

Bob Rea
pet...@petard.us
-- 
Bob Rea
mailto:gapet...@stsams.org
http://www.petard.us
http://www.petard.us/blog
http://www.petard.us/gallery

Where is Bill Stringfellow
now that we really need him?
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Needing Help

2009-06-30 Thread Bob Rea
On Tue June 30 2009 3:20 pm, you wrote:
> On Tue, Jun 30, 2009 at 1:06 PM, Bob Rea 
 wrote:
> > 
> > If I input my own name and dob, it works:
> > b...@gandalf:~/python/MakingUse/Chapter05> python
> > code1.py Enter your first name:  Bob
> > Enter your last name:  Rea
> > Enter your date of birth, mm-dd-:  03-05-1943
> > You can chose one of the following login names:
> > 1.   BobR
> > 2.   BobR53
> > 3.   RBob43
> > 4.   BRea66
> >
> > If I use the data listed in the book, it fails:
> > b...@gandalf:~/python/MakingUse/Chapter05> python
> > code1.py Enter your first name:  Laura
> > Enter your last name:  Jones
> > Enter your date of birth, mm-dd-:  12-24-1980
> > You can chose one of the following login names:
> > 1.   LauraJ
> > 2.   LauraJ2412
> > 3.   JLaura80
> > Traceback (most recent call last):
> >   File "code1.py", line 67, in ?
> >fourth=fname[0]+lname+ age_func()
> > TypeError: cannot concatenate 'str' and 'NoneType'
> > objects
> >
> > What is going on here?
>
> Well the first line after "Traceback" give you the line
> of code and the filename. Which happens to be code1.py
> line 67.
>
> TypeError is the type of error - specifically you tried
> to do something with incompatible types. In this case,
> adding together a string and NoneType.
>
> I'll do a little digging, but my guess is you have a
> problem with your age_func() not returning any value.
>
> HTH,
> Wayne

Why doe sit work with a dob in 1943 and not with one in 1980 
then, that's what really bugs me
-- 
Bob Rea
mailto:gapet...@stsams.org
http://www.petard.us
http://www.petard.us/blog
http://www.petard.us/gallery

Where is Bill Stringfellow
now that we really need him?
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor