![]() It a small quiz which you can make for yourself as well or your friends. ![]() This is a very simple text-based game in python. ![]() I don't know where to find sys.path or how to set that up, so I don't think I have set up the project correctly for all imports to work right, but it seems the first level of imports is working and it's only the last level where it is going wrong. Let’s now implement some easy games in Python that you can build as a beginner to get a headstart in your learning curve 1. The error only seems to appear when a source file within the Classes folder imports from another source file within the Classes folder. Obj = CalibrationWindow('Test CalibrationWindow', '600x400') Super()._init_(windowTitle, windowGeometry) Obj = ToplevelWindow('Test ToplevelWindow', '600x400')įrom ToplevelWindow import ToplevelWindowĭef _init_(self, windowTitle, windowGeometry): The source file essential contents are as follows: # File: main.pyįrom Classes.CalibrationWindow import CalibrationWindow I added the empty _init_.py files, created in nano, in order to try to get the imports working, but have not noticed any improvement. My project directory structure is as follows: gui This python library features a variety of implementations from neural network forming blocks functions, layers, optimizers, objectives, and others. I'm using thonny 3.3.10 via ssh hosted by a Raspberry Pi running raspbian buster and python 3.7.3. It is capable of running on Microsoft Cognitive Toolkit, PaidML, TensorFlow, and other platforms as well. It has simple and easy use user interface with some basic features like debugger, code completion, etc. The code in ToplevelWindow.py looks good. Thonny is a simple IDE specially designed for beginners. The code in CalibrationWindow.py looks good.Īlso, when I run ToplevelWindow.py in thonny, it shows: However, when I run CalibrationWindow.py in thonny, it shows: ModuleNotFoundError: No module named 'ToplevelWindow' I'm getting the following message in thonny Assistant when I run main.py: I expect my application to run without generating errors. I want to resolve these errors so that the application can run with the new project directory hierarchy, making it possible to create parallel projects that make use of my Classes library. The application ran fine as a single source file, but now with all the imports, it is not able to run, due to missing module errors. I began developing my python3 application in a single source file, called main.py, but then began to implement sub-windows as classes and moved each class into a separate source file in the Classes subdirectory.
0 Comments
Leave a Reply. |