photonlines / Python-Prolog-Interpreter

A simple Prolog Interpreter written in a few lines of Python 3. It runs a limited subset of Prolog and uses backtracking and generators in order to perform its magic.
MIT License
238 stars 25 forks source link

NameError: name 'root' is not defined #2

Open stefan-c-kremer opened 4 years ago

stefan-c-kremer commented 4 years ago

src/Editor.py line 141 should be changed from:

self.menu_bar = Menu(root)

to

self.menu_bar = Menu(self.root)

The former doesn't work unless you define a global root variable. But you already have root stored as a member variable within the object, so the latter solves the problem.

Also line 297:

root.resizable(width = FALSE, height = FALSE)

Should read:

root.resizable( width=None, height=None );

(Thanks for creating this and posting it on GitHub. I find it useful.)

Stefan

photonlines commented 4 years ago

Thank you for the feedback Stefan - I'll make sure to take a look and update my code as per your suggestion when I get a chance! I'm happy that you're finding it useful and I appreciate the help!