mentby.com
Blog | Jobs | Help | Signup | Login

loading
[Oscar]


[Rafael]

As Oscar says you are invoking your script with Python 2. Python 2's input()
function evals user input as a Python expression. For example if you run a
script

print input("your input please: ")

and you type

1 + 1

the script will print

2

Likewise if you type

Rafael

the script will look up the value of a variable named Rafael. This doesn't
exist and therefore you get an exception.

But this is all a distraction -- how exactly are you invoking what you think
is Python 3.3.0? What is your operating system?

If you are using Linux or OSX open a terminal window and try to run your
script from that terminal window with

python3.3 ~/Documents/3_Tufcik.py
Plus, it doesn't work:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'object' object has no attribute 'this'

No, but you could make

flags = Flags(this=False, that=True)

work.
I never ran into that, but apparently you cannot pass self as a keyword
parameter:

...     def add(self): pass
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unbound method add() must be called with A instance as first
argument (got nothing instead)

Read more »

Profile Widget
Copy and paste this HTML code to your blog or website: