Nov-22-2019, 05:08 PM
(Nov-22-2019, 04:43 PM)Larz60+ Wrote: Again:
The error is:
Which very clearly states that
Error:Exception in Tkinter callback Traceback (most recent call last): File "/home/captainkirk/.pyenv/versions/3.7.4/lib/python3.7/tkinter/__init__.py", line 1705, in __call__ return self.func(*args) File "/media/captainkirk/Data-3TB/projects/T-Z/T/TryStuff/src/PyMatplotlib.py", line 17, in inputik nPoints = int(pocetbodu_entry.get()) NameError: name 'pocetbodu_entry' is not defined'pocetbodu_entry' is not defined
I suggest that you run step by step through a debugger and watch the program flow.
I am getting different error, I'm sorry if I am misunderstanding something, but as far as I can understand it, pocetbodu_entry is defined and works fine, its the line 68 which I can't figure out, without the for cycle on line 67, everything works fine and gets ploted.
Error:C:/Users/Admin/Downloads/Škola/Python projects/Hangman/testtest.py:66: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
ax2 = fig.add_subplot(111).plot(xpoints, ypoints, "ro")
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "C:/Users/Admin/Downloads/Škola/Python projects/Hangman/testtest.py", line 19, in inputik
vykresleni()
File "C:/Users/Admin/Downloads/Škola/Python projects/Hangman/testtest.py", line 68, in vykresleni
ax2.text(points[nr][0], points[nr][0], nr)
AttributeError: 'list' object has no attribute 'text'