Join Robin Andrews for an in-depth discussion in this video Your Python setup, part of Python 2d Lists: A Project-based Approach.
- [Instructor] For this course, it's important you can run Python scripts from a command line. Now one way of doing that on Windows is to navigate to the folder where your script is, and then to hold down Shift and right-click on that folder. This will give you the option to open a PowerShell window here. At this point, you can type the word python, and then the name of your script. Mine is called script.py. And then hit Enter, and it will run. Now, if there's a problem at this point, then it's quite possibly because you do not have Python installed in your system path. If you followed the standard procedure for installation, then you should be okay, and Python should be in your system path. But if it isn't, then I recommend that you check out some of our other courses to help you do this because that is beyond the scope of this course. Those courses will take you through the specifics for your operating system. Now I'm just going to talk a little bit about my preferred development environment for projects of this scope. I use Notepad++ because it's very lightweight and it loads instantly, unlike something like PieCharm, which takes quite a while to load and has all sorts of features that you're unlikely to make use of. Notepad++ is basically just a text editor with some advanced features. There are two changes to Notepad++ that I've made. The first is that I've installed a plugin called Python Indent, which is very important for correctly indenting your Python code. The way you install that is you go to the Plugins menu, select Plugins Admin, and you select it from the menu here. If you type python in the search bar, then it will come up as an option. For me, it's already installed, so it comes up in my installed section. The other change that I've made is to assign a keyboard shortcut for running Python scripts. The way that I've done that is I've used the Run menu, selecting Run, and then pasting in this code here from line four, which invokes an instance of PowerShell and executes the script and keeps the window open. That's what the different instructions are doing there. If I do that, and then I run, you can see that it works. Now, if you want to save that to a shortcut, you can do the same thing, but this time you click on Save, and you can select the combination of keys you wish to use to run your script. I personally use SHIFT and F6, but the choice is entirely yours.