September 2018
Intermediate to advanced
426 pages
10h 46m
English
In this example, the os module is used to list the contents of the current working directory with the os.getcwd() method.
You can find the following code in the show_content_directory.py file in the os module subfolder:
import ospwd = os.getcwd()list_directory = os.listdir(pwd)for directory in list_directory: print directory
These are the main steps for the previous code: