Python Forum
problem in finding modules - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: problem in finding modules (/thread-227.html)



problem in finding modules - katanou - Oct-01-2016

hi,

i,m a complete newbie to python and this forum, so please correct me if i happen to violate any forum rules, by posting in the wrong subforum or anything alike.

i'm working with python 3.5.2 under windows 7.

i'm trying to do the turtleworld assignment from the book by allen downey ("think python", 1st ed., chap.4)
for the assignment i need to import objects from a module. while doing this, i'm told that a certain module, named Gui, which needs to be used in the process, is not existent. the message is:
    from Gui import Callable
ImportError: no module named 'Gui'

the thing is that gui.py is actually located in one of the subfolders of the folder where all the python files are located. i also appended that specific subfolder to the python path, to make sure the system finds it, using the command sys.path.append("\swampy-2.1.5.python3"), even though i'm not sure this is actually necessary, given that the the folder where all the python files are located had already been added to the python path before.


RE: problem in finding modules - snippsat - Oct-01-2016

I don't like this approach from author,making wrapper around(Tkinter,Turtle...ect) to make stuff easier.
The problem is that you would never use this in the real world.
I think it's okay to skip these chapter.

Download swampy-2.1.5.python3.zip
Unpack eg to root folder of Python.
For me it look like this:
import sys
sys.path.append('C:/Python34/swampy-2.1.5')

from TurtleWorld import *
world = TurtleWorld()
bob = Turtle()
print(bob)
wait_for_user()