*This blogpost is for Windows users only*

Mastery 1 – Ability to create Python file and run from command line.

For this mastery, you only need a proper shell, and the best option (as told by our teacher Ken) is Cygwin, if you don’t want to have any other issue with the Python installation directory, make sure you install the Python package inside Cygwin installation instead of installing Python the regular way.

Capture

Once you finish installing Cygwin, the next thing to do is open it and type inside the shell python3, this will open up Python inside the shell and it will be ready to run any program you tell it.

Examples

CaptureCapture

Mastery 2 -Ability to create Python project in IDE and run inside the IDE.

Creating a Python project in an IDE is an easy task.
First of all you need to install a text editor like Atom anda shell like Cygwin.

For proper Cygwin installation, see Mastery 1.

Once you have everything set up, you are ready to create a Python file.

Open up Atom, if it’s the first time you open it, it should look something like this:

Untitled

Just close these Welcome windows and go to File > New File, this will create a new file, but it won’t be a Python file, for it to be a Python file go to File > Save As… and save it with any name you want finishing it with .py,

For example:Untitled2CaptureNow, write your code in the file inside Atom, once you hace finished your project, save it again, and use Cygwin to run it.
Inside the shell type cd /cygdrive/c/Users/ and then your username and the directory where your project is saved in.

Once you’re inside the directory you wanted, inside the shell type python 3 filename.py, this will run the file named filename.py inside the specified directory and whatever your program does will be executed.

WSQ03

And that’s it!

CC BY 4.0 Masteries 1 & 2 by davidg2897 is licensed under a Creative Commons Attribution 4.0 International License.