Re: [Tutor] intefaces in python

2009-06-30 Thread Jan Ulrich Hasecke
Am 28.06.2009 um 17:00 schrieb Amit Sethi: Hi , I don't suppose python has a concept of interfaces. But can somebody tell me if their is a way i can implement something like a java interface in python. The Web Framework Zope has a notion of interfaces. http://pypi.python.org/pypi/zope.int

[Tutor] newton's method for system of nonlinear equations

2009-06-30 Thread kgotlelelok
Hi can someone help me with my program demostrating Newton's method for system of nonlinear equations below. Line 45 gives an error saying return is outside the function and I don't know how to rectify that. I neewd this program to print differnt values of x until the differnce between previous x a

Re: [Tutor] newton's method for system of nonlinear equations

2009-06-30 Thread Luke Paireepinart
kgotlele...@galmail.co.za wrote: Hi can someone help me with my program demostrating Newton's method for system of nonlinear equations below. Line 45 gives an error saying return is outside the function That's because you have a return outside of a function. for k in range(n-1,-1,-1): b

Re: [Tutor] [Pythonmac-SIG] GASP on OSX 10.5.6

2009-06-30 Thread David Warde-Farley
On 29-Jun-09, at 7:06 PM, Chris Rebert wrote: Mac OS X apparently not a supported platform: https://answers.launchpad.net/gasp-code/+faq/42 It looks like the code is pure python and depends on pycairo, so in theory it should work provided cairo which has a Quartz backend) and pycairo work

[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 mai

Re: [Tutor] Needing Help

2009-06-30 Thread vishwajeet singh
You can put your script in pastebin http://python.pastebin.com/ I don't think any one will mind you pasting code in mail but pastebin makes it easier to read On Tue, Jun 30, 2009 at 10:36 PM, Bob Rea wrote: > I am jsut beginning to learn python form a book. I have ru

Re: [Tutor] Needing Help

2009-06-30 Thread Daniel Woodhouse
You can use something like pastebin.com if you don't want to post huge chunks of code. You could also just tell us what problem occurred, was there a traceback (error message)? On Tue, Jun 30, 2009 at 8:06 PM, Bob Rea wrote: > I am jsut beginning to learn python form a book. I have run > into a

[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

[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

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/ > 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 Pytho

Re: [Tutor] PYTHONPATH-corrected

2009-06-30 Thread Steve Willoughby
On Tue, Jun 30, 2009 at 02:33:27PM -0400, Bob Rea wrote: > 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

Re: [Tutor] Needing Help

2009-06-30 Thread Wayne
Oops, forgot my reply-to-all On Tue, Jun 30, 2009 at 2:20 PM, Wayne 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:

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,

Re: [Tutor] Needing Help

2009-06-30 Thread Marc Tompkins
On Tue, Jun 30, 2009 at 12:27 PM, Bob Rea wrote: > Why doe sit work with a dob in 1943 and not with one in 1980 > then, that's what really bugs me > Nothing to do with the year. Your birth month is BEFORE June; her birth month is after. -- www.fsrtechnologies.com __

[Tutor] Need help with python game program

2009-06-30 Thread jonathan wallis
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, > > Way

Re: [Tutor] Need help with python game program

2009-06-30 Thread Mark Tolonen
"jonathan wallis" wrote in message news:57b8984c0906301738w1fb0e660m6bb2123399f27...@mail.gmail.com... My problem is simple, is their a way to make a variable equal multiple numbers? Such as X = 5 through 10, and then the program makes x equal something random 5 through 10, or something simil

Re: [Tutor] Need help with python game program

2009-06-30 Thread Luke Paireepinart
Please don't reply to messages like this. If you are starting a new thread, send a new e-mail to tu...@python.org. DO NOT start a thread by replying to another message. If you do, it will bork on people's machines who use threaded e-mail readers. also, please remove long, irrelevant quotations

Re: [Tutor] Need help with python game program

2009-06-30 Thread Dave Angel
jonathan wallis wrote: My problem is simple, is their a way to make a variable equal multiple numbers? Such as X = 5 through 10, and then the program makes x equal something random 5 through 10, or something similar. For a short question, why did you quote an entire mailing list digest?

[Tutor] Python Programming exercise

2009-06-30 Thread Daniel Sato
I have been going through some Python Programming exercises while following the MIT OpenCourseWare Intro to CS syllabus and am having some trouble with the first "If" exercise listed on this page: http://en.wikibooks.org/wiki/Python_Programming/Conditional_Statements#If_Exercises I have been able

[Tutor] calculating a sort key and operator.attrgetter()

2009-06-30 Thread Vincent Davis
I have a class with an attribute which is a list "rank_list" this is a list of instances f another class that has attributes "quality, is_observed" if I want to sort the list by the attribute "quality" I can just use, self.rank_list.sort(key=operator.attrgetter('quality')) But I want to sort like t