system.
- If you do not have the LXDE graphical interface started automatically at boot, start it
now by typing startx and pressing Enter.
- Open the LXTerminal by double-clicking the LXTerminal icon.
- Open the Python interactive shell by typing python3 at the shell prompt and
pressing Enter.
- At the Python interactive shell prompt, >>>, type import os and press Enter.
Python imports the os module into your Python shell.
- Type import time and press Enter to import the time module and all its
functions into your Python shell.
- Look to see if the os module has a .py file by typing the command
os.file. Note that before and after the file in the command are two
underscores (_). Press Enter to see if an absolute directory reference and a file
ending in .py are shown. You should see that this module does have a .py file.
- Look to see if the time module has a .py file by typing the command
time.file and press Enter. You should receive an error because the time
module does not have a .py file. (It’s okay that this step generates an error!) Since
the time module does not have a .py file, it may be built-in.
- To determine whether the time module is built-in, import the sys module by
typing import sys and pressing Enter.
- Produce a list of the built-in modules by typing sys.builtin_module_names
and pressing Enter. Do you see the time module listed in the output of the Python
statement? You should!
- Get a little help on the time module by typing help(time) and pressing Enter.
In the help documentation, what are the two representations of time? Can you find
this information? One is called the epoch, and the other is a tuple.
- Still looking at the time module’s help information, locate the time() function
description. Which time representation does it use: epoch or the tuple?
- Press Q to exit the time module’s help information.
- To import the antigravity module, type import antigravity and press
Enter. You might need to wait a few minutes, until you see an Easter egg! You should
see the Midori web browser open up, with a little surprise on the inside. Read the
webpage that appears and then hover your mouse over it to see the secret message.
Funny!
By the Way: What Is an Easter Egg?
An Easter egg is a secret message or hidden surprise. You have to know
exactly the right commands or keystrokes to find it.
- Close the Midori web browser by clicking the X on the upper-right side of the
window.