Strange behaviour of input() function (Python 3.2)

sunrrrise sunrrrise at gmail.com
Sun May 22 18:43:53 EDT 2011


Hello,
this is my first post. I'm trying to learn Python language which I find great, but I have a big problem with its editors/IDEs.

I have tested IDLE (which installed with Python3 from ActiveState), Notepad++ and finally Komodo EDIT. I don't like IDLE GUI, but Notepad++ and Komodo EDIT looks nice for me.

Unfortunatelly there is something wrong with input() command when I'm using Komodo or Notepad. For example this code:

a = input("Wprowadz zmienna a: ")
b = input("Wprowadz zmienna b: ")
print("a to: ", a)
print("b to: ", b)
print(int(a) + int(b))

works well in IDLE, but when I'm switching to Notepad/Komodo I'm getting something like this:

Wprowadz zmienna a: 3
Wprowadz zmienna b: 2
a to:  3
b to:  Wprowadz zmienna b: 2
Traceback (most recent call last):
  File "c:\users\sunrrrise\Desktop\test.py", line 9, in <module>
    print(int(a) + int(b))
ValueError: invalid literal for int() with base 10: 'Wprowadz zmienna b: 2'

I don't know what is going on. Any ideas or, better, solutions?

My OS: Windows 7 64bit, ActiveState Python 3.2, Notepad++ 5.9, Komodo Edit 6.1, coding: UTF-8

Regards,
sunrrrise



More information about the Python-list mailing list