You must ensure that this file is placed in the same directory.
Python3
>>> import tkinter
If it is not installed, an ImportError exception will be raised, in which case you can install it using the following command (use Ctrl + Z to exit the Python prompt):
sudo apt-get install python3-tk
If the module did load, you can use the following command to read more about the module (use Q to quit when you are done reading):
>>>help(tkinter)
You can also get information about all the classes, functions, and methods within the module using the following command:
>>>help(tkinter.Button)
The following dir command will list any valid commands or variables that are in the scope of the module:
>>>dir(tkinter.Button)
You will see that our own modules will have the information about the functions marked by triple quotes; this will show up if we use the help command.
The command line will not be able to display the graphical displays created in this chapter, so you will have to start Raspberry Pi desktop (using the command startx), or if you are using it remotely.