Apr-21-2020, 08:24 PM
Your codelooks weird. What is the name of this file? Is it test3.py?
You use "import" to import a module so you can use the resources in that module. Python comes with a bunch of standard libraries (math, intertools, types, pprint, datetime, io, sys, tkinter, …) If my graphical user interface program uses tkinter, the top of the fill will have a line like this:
What does test3.py look like?
You use "import" to import a module so you can use the resources in that module. Python comes with a bunch of standard libraries (math, intertools, types, pprint, datetime, io, sys, tkinter, …) If my graphical user interface program uses tkinter, the top of the fill will have a line like this:
import tkinterThen I can use functions from that module like:
window = tkinter.Tk() # Make top level window for programYou can write your own modules and import them in other modules as well. It looks like this program is trying to import fcn_b from module test3 (file test3.py) However, the following code immediately defines a new fcn_b, so what was the point of the import? It is also unusual to see an import statement that isn't at the top of the file.
What does test3.py look like?