June 2017
Beginner to intermediate
274 pages
6h 49m
English
All we have to do is inherit from the cmd class and define the methods that implement commands the user can type.
Create a usecmd.py file with the following code:

We'll set the prompt attribute to a string that will be used to prompt the user for a command. Run the following command to execute the usecmd.py file:
$ python3 usecmd.py
The output of the preceding command is as follows:

Next, we'll create an instance of our Interface class (shown in the following screenshot) and call it the cmdloop method. Presto! Instant interface: ...
Read now
Unlock full access