Hello! This is my first entry python related blog post. This post will serve as a brief tutorial to PYCHARM.
What is PYCHARM?
During installation, PYCHARM will prompt you this:
After the installation, you will be prompted to create a new project. When you created a new project you will see something like this:
To get started, right-click your folder. In my case it’s called Blog.
Click Python File. You will create JUST a python file and named it whatever you want, I’ll name it “MyFirstPythonFile.” Press the ENTER when you’re done. You should see your new python file in front of you now.
x= 5 print(x)
Then go to Run > Run… and click the name of your python file. It will run and should print 5. In the future you can just click the play button on the top right corner of the window.
Delete everything previously and type this in:
import numpy as np newArray = np.array([1,2,3,4])
“Numpy” is underlined in red, why? We need to import it.
Go to File > Settings > Project: PROJECTNAME > Project Interpreter
Press the plus(+) button.
A new window will pop up, search “numpy”, once you find it click install package on the bottom.
Install the package, it will tell you once it successfully installs it. Afterward, go back to your python file and you will notice that numpy isn’t red anymore.
If we press the play button it should run without any errors.
Click where the dot is and you will see a big red dot. That is called a breakpoint.
Press the bug icon next to the play button. You will notice that our program didn’t print the contents of newArray, but just stopped at line 2. Don’t get scared! Everything is working just fine, you’re just in debug.
Press F8 and you will move down a line, you will see newArray got initialized.
Press F8 again and you will see the print string.
This is the basics of PYCHARM.