Lesson 3 - Python IDEs

Before we start coding, we need to know where to write our code. Python files are known as scripts and their file names end in “.py” By default, once you have Python installed, running a .py file should run it in python. But how do you make .py files?


You can write python scripts a number of ways. For example, you can write them in notepad and then save them as .py files. However, the most common way is to use integrated development environments, or better known as IDEs. The two most common IDEs people use are IDLE and PyCharm.


IDLE is the IDE that comes with Python when you install it, and you should have some experience with IDLE after those tutorial videos. It is very raw and offers almost no help for beginners. PyCharm is a more user friendly IDE that helps you code and even offers suggestions for how to fix your code when there is an error. 

 

The best analogy I can think of is IDLE is similar to base R and PyCharm is more like Rstudio.

I originally learned on PyCharm, but now I exclusively use IDLE. PyCharm is great, but it has a really annoying flaw. Sometimes it can mess with your working directories and thus be unable to run your scripts. I don’t know why it does it, but it is really annoying when your script is perfectly fine, but PyCharm throws an error. 

You can use whichever your prefer, but just know the pros and cons of each!

Python IDEs

PyCharm

Video Tutorial