mac console dir 1

mac console dir

% ls

Here is what the above code is Doing:
1. We’re importing the os module, which contains a number of operating system functions.
2. We’re setting the variable path to the string ‘.’. This is a relative path, meaning it’s relative to the current working directory.
3. We’re calling the os.listdir() function, which returns a list of the files in the directory.
4. We’re passing the list of files returned by os.listdir() to the print() function, which prints them out.

Similar Posts