SETTING UP PYTHON AND ATOM

For the beginning of this course we will be using the Atom text editor in order to create our programs. This program is free and is compatible with both PC and Mac platforms.

While this will allow us to create the Python scripts, we will also need to install Python itself. This will allow us to interpret the code written in Atom. Again, more geeky stuff that we’ll get into later.

Follow the directions listed below and see your teacher if you have any issues.

Downloading Python

Before we begin coding, you will need Python on your computer, but you may not need to download it. It is important to know that we will be using Python 3 for this course.

First of all check that you don’t already have Python installed by going to the start menu and seeing if Python has been installed. If it is installed, click on the shortcut to open the interpreter. At the top of the interpreter screen there should be a version number (more on that soon).

What do you do if you don’t have it installed or if you’re not sure if it’s the most recent version? Read on!

  • Go the the website https://www.python.org/downloads/ and make sure that you have the right operating system (Windows, Mac OS, Linux, etc…)
  • Check the version number for Python 3 (at the time of creating this webpage it was 3.6.4).
  • If the version number matches the one installed on your computer, you are done with this section. Otherwise, read on.
  • If Python is not installed on your computer OR you have an older version, click the link for Python 3 and download the .exe file.
    • If you are installing at school, you will have to install from either the data drive (D:) or your network drive (P:). It will depend on the computer. See your teacher if you are having difficulties.
  • Once downloaded, continue to the next section to learn which settings to choose.

Installing Python

After you have downloaded Python, run the .exe file to start the installation process.
NOTE: This guide was created for Python 3.5.2. The version you will be installing will most likely be newer than this one.

Next, make sure that you have chosen to install for all users and to add Python to PATH. This will let our interpreter know where Python was installed and also allow other users to use Python should they log on to your computer (helpful in the school lab).

Select all of the features you would like to install. Best option is to just select them all.

Finally, select all the advanced options that you might need. Again, you can simply install them all.

You should receive the message that Python has now been successfully installed.

To make sure that your installation was successful, choose Python from your list of installed programs and you should see a command prompt.
NOTE: Make sure you are choosing Python 3.x.x and not IDLE.

Once opened, type in the following code:

[python]print(‘Hello World!’)[/python]

You should see the text being printed to the console.

Congratulate yourself on a job well done! Now, move on to the section on how to install Atom.

Installing Atom

Installing Atom on your computer is quite easy. Follow the steps listed below.

Atom Logo

Go to https://atom.io and find the download button at the top of the page. It should already show a download for the platform you are using (ie. Windows, Mac OS, Linux). If not, click the ‘Other Platforms‘ link to find the platform you are using. See below for an example.
NOTE: If you are installing Atom at school, it will download to your network drive (P:). You may have to move it to your your data drive (D:) in order to install it. See your teacher if you have any issues.

Atom Website Screenshot

Once the file is downloaded, execute it and install the software on your computer. It will do what it needs to automatically. There are no options to select.

Configuring Atom

Atom, on it’s own, has very basic functionality. Where Atom really shines is in the packages that have been developed for it. Packages add additional functionality to the software. You can learn more about packages by visiting
http://flight-manual.atom.io/using-atom/sections/atom-packages/.

In this section, we will install some packages that you will need and/or may find useful throughout the course. Follow the steps listed below.

With Atom open, click on File –> Settings. You should now see the window shown below somewhere within Atom.

Atom Settings Page

Click the Install link on the left side of the menu.

You will now be able to search for packages to install. Type each of the packages listed below into the search field and press “Packages”. Do not press “Themes” as you will get the wrong list.

Once the correct plugin appears, press the “Install” button.

Packages to Install

Here is a list of all packages to install. Websites have been included should you want more information about the package. Use the program Atom itself to install the package and not the websites listed below.

atom-python-run
Allows you to run Python scripts from Atom. No need to open the interpreter separately. YOU MUST INSTALL THIS
https://atom.io/packages/atom-python-run

autocomplete-python
Python completions for packages, variables, methods, functions, with their arguments. Will autocomplete code snippets for you.
https://atom.io/packages/autocomplete-python

language-python
Adds python language support, such as syntax highlighting and snippets, to Python files in Atom
https://atom.io/packages/language-python

file-templates
Allows you to start a file based off of a template. Great for adding headers to your files.
https://atom.io/packages/file-templates

minimap
minimap give yous a full preview of your source code.
https://atom.io/packages/minimap

Beautify
Beautify will turn your messy code neater and more readable. It has great support for programming languages, such as HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C ++, C #, Objective-C, CoffeeScript, typescript, and SQL. After installing this package, to run it, just right-click and choose ‘Beautify editor contents’.
https://atom.io/packages/atom-beautify

Highlight Selected
Highlight selected allows you to select or highlight a keyword or variable within your script and will show you all other instances of that selection.
https://atom.io/packages/highlight-selected

User Manual

For those of you that want to have full control over the software You can have a look at the user manual.
http://flight-manual.atom.io/

Testing the Atom Installation

Let’s see if everything is working properly. Just like when you tested the Python install, place the following code in a new window.

[python]print(‘Hello World!’)[/python]

Save the file as helloWorld.py (very important that you add the .py extension at the end) and press F5 or F6 on your keyboard to run the file. If you see a window that looks like the one below then everything is ready to go.

If not, check that you’ve followed all the steps listed above correctly and see your teacher if you need help.