The last thing we did in Installing the PyCharm IDE was to open the pycharm-test
directory in PyCharm.
Rule #1: Keep each project, assignment, and lab in its own directory. This is the structure you want:
~/seng-201
├── assignment1
├── assignment2
├── lab01
├── lab02
└── pycharm-test
├── fib.py
├── hello.py
└── hello2.py
seng-201/
subdirectory in my home directory symbolized by the ~
. The tilde (~
) is understood by your Terminal to mean “the current user’s home directory”.seng-201/
, I have created subdirectories for each project.Rule #2: Open the specific project directory in PyCharm, not the parent directory. Suppose you want to work on assignment1
, then you need to open the assignment1/
directory. You open a folder in PyCharm in two ways:
cd
into the project folder, then type (Windows) pycharm64 .
or (Mac) pycharm .
. Note that the .
is important.File → Open
. Select the project directory, then click OK
.The folder you open serves as the working directory for PyCharm. Do not open the parent directory, seng-201/
, as it may create challenges running the Python code in the various subdirectories.
The Project pane is where you browse and manage files. Open it by clicking on the foldier icon in the left sidebar:
Things you can do here include:
pycharm-test
name. You created this folder when following the labs to install PyCharm.New → Python File
. Give it a name like foo.py
.
foo.py
at the top.