Re: [Tutor] Need help on How to Think Like a Computer Scientist:Learning with Python.
We've all been there. But what exactly is the problem you're having? Its really hard to know what sort of help you require if you didn't tell us what the problem is. Please help us to help you! Ciao - Original Message - From: Vanneth Tea [EMAIL PROTECTED] To: tutor@python.org Sent: Wednesday, August 15, 2007 6:08 PM Subject: [Tutor] Need help on How to Think Like a Computer Scientist:Learning with Python. Hello All, I am new to computer programming and chose to learn Python. Now I am stuck with certain codes that I need help. Please let me know if there is an answer list to the exercises in How to Think Like a Computer Scientist: Learning with Python. I followed and did good on most of the exercises but I have been stuck on a few of them which burned me up after spending days and nights trying to make them works. I hope you understand the feeling when you are stuck and need a drop of water to keep alive. I really appreciate any assistance you can give. Thanks. Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Class error
Hello people, I was trying my hands on Python's Classes and have a first hurdle and can't seem to get past it. -Below is the error message -- Traceback (most recent call last): File C:/Development/python/EmplAddrBookEntry.py, line 3, in -toplevel- class EmplAddrBookEntry(AddrBookEntry): TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) -end- Here are the classes, and they are saved in diferent files --AddrBookEntry.py- class AddrBookEntry(object): 'address book entry class' def __init__(self, nm, ph): self.name = nm self.phone = ph print 'Created instance of ', self.name def updatePhone(self, newPh): self.phone = newPh print 'Updated the phone number to: ', self.phone --EmplAddrBookEntry.py- import AddrBookEntry class EmplAddrBookEntry(AddrBookEntry): def __init__(self, nm, ph, id, em): AddrBookEntry.__init__(self, nm, ph) self.empid = id self.email = em def updateEmail(self, newEmail): self.email = newEmail print 'Updated with new email', self.email - The error message spills out onto the IDLE Python Shell window when I press the F5. Your help is highly appreciated. --Dom ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Class error
Thanks a million Alan, Your suggestion helped solve the problem. Besides, why did I have to do this: class EmplAddrBookEntry(AddrBookEntry.AddrBookEntry): The AddrBookEntry and EmplAddrBookEntry classes are in the same folder, I didn't think I needed to call another module or something.. Well, I need to learn more :) Thanks anyway --Dom - Original Message - From: Alan Gauld [EMAIL PROTECTED] To: tutor@python.org Sent: Sunday, June 17, 2007 7:28 PM Subject: Re: [Tutor] Class error Henry Dominik [EMAIL PROTECTED] wrote import AddrBookEntry class EmplAddrBookEntry(AddrBookEntry): This says you are creating a new class that inherits from the *module* AddrBookEntry. Notice that the error message referred to the module not the class... You probably meant: class EmplAddrBookEntry(AddrBookEntry.AddrBookEntry): def __init__(self, nm, ph, id, em): AddrBookEntry.__init__(self, nm, ph) Which makes this line become AddrBookEntry.AddrBookEntry.__init__(self, nm, ph) HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] information
Nice to have you around! This list is to help with any problem you may be having with the language and how to solve certain problems. So, if you have specific questions, please do post them. And be warned, no one here would like to do any homework for you. Enjoy you stay Dom - Original Message - From: issa karambal To: tutor@python.org Sent: Wednesday, September 06, 2006 10:47 AM Subject: [Tutor] information himy name is ISSA, from Chad, I am learning python, I want to have on tutor to help me to understand this good language of programmationplease, I am looking for the good answer from youregards and thanks Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2ยข/min or less. ___Tutor maillist - Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Problem with Pythonwin
It is very hard to know what caused that, but could you post the piece of code you were trying to execute?? Or did you get the error when you opened the Pythonwin without any code?? -- Dominik - Original Message - From: Asrarahmed Kadri To: tutor@python.org Sent: Sunday, September 03, 2006 10:34 AM Subject: [Tutor] Problem with Pythonwin Hi folks, I am new to Python and have just taken a few steps in this long journey.. I am using a windows box and I have installed Activestate ActivePython 2.4 When I start Pythonwin IDE, it gives me the following error: File "string", line 1, in ? File "C:\python\Lib\site-packages\pythonwin\pywin\framework\startup.py", line 49, in ? exec "import %s\n" % moduleName File "string", line 1, in ? File "C:\python\Lib\site-packages\pythonwin\pywin\framework\intpyapp.py", line 8, in ? import string File "C:\python\Lib\string.py", line 83, in ? import re as _re File "re.py", line 9, in ? i = input("Enter any positive integer\n")exceptions.EOFError: EOF when reading a line Can anyone help me with this?? Regards, Asrar ___Tutor maillist - Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Runing a Python program
Hello people, As a new python programmer, I created a directory in 'C:\python24\myPythonFiles', and added a simple python under the myPythonFiles directory; but when I tried running it on the Python Shell, I got the following error. import myPythonFiles.readOut Traceback (most recent call last): File "pyshell#3", line 1, in -toplevel- import mypythonFiles.readOut ImportError: No module named myPythonFiles.readOut How do I run a program that is placed on its own folder/directory? Thanks Henry ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor