VS Code is particular. For now, we want to make sure everything we're referencing is in its own folder. So, create one!
For Example, if we were using this for Chapter 08 - Dictionaries, we may create a folder called:
CH08-01
You'll now have a VS Code Window which looks like this below:
Now, let's create a new python file in the project folder
Click the file PLUS button
Name Your file FILENAME.py
The .py extension is important!!!
For reasons that will be explained later, create a file called __init__.py
That's 2 underscores init and 2 underscores .py
Its called a dunder file because it has DOUBLE UNDERSCORES
Add this file to the folder you created and name it utility_functions.py
You should see it appear in the file structure as soon as it's saved to that location
Since we want to use the functions in this file in our code without rewriting the functions, we can use the line
import NAME_OF_FILE_TO_IMPORT as SHORT_NAME
You can see how we did that with utility functions in our project:
Since we're imported, if we want to use clear screen or wait for input, we use DOT NOTATION!
Type the SHORT NAME that we used, hit the dot, and the functions come up!!