[Tutor] noob python question

boB Stepp robertvstepp at gmail.com
Mon Oct 26 09:54:33 EDT 2015


Greetings!

On Sun, Oct 25, 2015 at 6:16 PM, bob5487 <evolution5487 at gmail.com> wrote:
> Howdy!
>
> Reading *Learn Python the Hard Way* Zed Shaw
>
> All good so far but got to Ex 42 dealing with classes...
>
> I get a TypeError: getattr(): attribute name must be a string when I run the
> program...
>
> I looked online, python reference manual 3rd edition, etc...
>
> I was wondering if anyone has experience with this book because I hit a road
> block

As many will not have access to this book, what is usually done here
is to copy and paste your code as well as your FULL error message into
a plain text email.  Also, it is usually helpful to state your Python
version and OS type and version.  This will give everyone the
information they need to help you.  Also, you probably need to
summarize what exercise 42 is asking you to do.

I have a copy of that book at home.  If memory serves me correctly, it
is written for Python 2.  If that is the case you probably want to be
looking at the Python 2 documentation.  Also, if you are trying to run
Python 2 code and you have Python 3 installed on your computer, you
will from time to time run into issues just because there ARE
differences between Python 2 and 3 syntax in some areas.

HTH,



-- 
boB


More information about the Tutor mailing list