Tells what your current directory is. Stands for "print working directory".
Change directory. If you run it without arguments (e.g., type "cd" then enter), it goes to your home directory. Remember you can type "tab" to get possible choices.
Remember, "directory" and "folder" basically mean the same thing. Ways to use it:
- Change into the directory.
cd "Some Directory"
- If the directory name has a space in it, you need to surround it with quotes.
- Go to the parent directory.
- (by itself) Go to the home directory.
- Go to the directory SomeDirectory that is in your home directory.
List files. Use
ls -F to add a "/" to the end of
ls -G to color-code.
Create a new directory. Use it like:
Running Python Programs
Run the program something.py (which must be in the current directory), using Python 3
Run the program something.py using Python 2.7
python3 -m doctest something.py
Run the doctests in the program something.py. Code in a "main block" will not be run. Remember, a "main block" looks like this:
if __name__ == "__main__": print("This is the main block.")
It also works with Python 2 (i.e. using