Skip to main content
It looks like you're using Internet Explorer 11 or older. This website works best with modern browsers such as the latest versions of Chrome, Firefox, Safari, and Edge. If you continue with this browser, you may see unexpected results.

Python: Getting Started

A collection of resources aimed at helping users get started and feel comfortable with using the Python programming language

What is Python?

Python is a high-level, general purpose programming language and was created by Guido van Rossum, first released in 1991. 

Python's design focuses on easy readability and takes an object-oriented approach. This means that the code should be clear, logical, and easy to interpret for programmers. It is general purpose and comes with a lot of utility straight "out of the box". 

These things make it a great first language to learn when getting started with computer programming. 

To learn more, head to https://www.python.org/

Command Line - What it is and how to use it

What is the Command Line Interface?

The command line is a program that takes in commands, which it then passes on to your operating system so your computer can run the commands. It's a text interface, which means that the interaction is solely text-based, no images or clickable items.

Why Learn How to Use the Command Line?

The command line is a really efficient and effective way to navigate, organize, and edit the files on your computer. They're a more advanced way to control what's going on with your machine, and being comfortable with the command line will make working with your Python programs easier. When you're working with programming languages, it's important to be comfortable with your computer. Working with the command line is a good way to do this. 

Terminal Icon - macOS

Finding the Command Line Interface on macOS

The command line interface on macOS is called "Terminal". To find Terminal, open up Spotlight Search (command + spacebar) and type in 'terminal". You'll see an application whose icon looks like a black box with a white greater than sign in it. 

 

Finding the Command Line Interface on WindowsWindows PowerShell Icon

On Windows, it's recommended that you use PowerShell. There are other options, but PowerShell is typically thought to be most useable. To find PowerShell, click Start, and use "Search programs and files" to find "powershell". Hit enter and PowerShell should open up. Note: this will only work on Windows 7 or later. 

Command Line Tutorial

Learn Python the Hard Way -- Command Line Crash Course

Codecademy - List of Command Line Commands

How to Install Python

Step 1: Checking if Python is Installed

 Check to see if you already have Python on your machine. This can be done by using the command line. On Windows, try py first. This is a relatively recent Python Launcher and will be more likely to find Python even if it wasn't installed in a more common default location. It will also show you any of the various versions you may have installed. If this does not work, yuo can enter python in the command line window. 

Either way, you should see a response from a Python interpreter which will include a version number in it's initial display. 

If you have a Python version that is 3.x or later, you'll be fine. Any version after 3.6.x is even better. If you have a 2.x version, you will need to install a newer version, as 2.x and 3.x are not compatible.

Step 2: Downloading Python

If you need to download Python, choose the most recent stable version from here: https://www.python.org/downloads/windows/. You have a choice between 32-bit (labeled x86) and 64-bit (labeled x86-64) and several options for installers. Choose whatever option with which you feel most comfortable. Don't install a 64-bit version if you have a 32-bit processor. The "x86 executable installer" is the default and will work just fine if you're unsure. If you end up wanting a different version, you can always uninstall Python and then reinstall the version you'd prefer .

Step 3: Running the Installer

Run the Installer. To do this, simply double-click the downloaded file and follow the dialog boxes. When given the option, it is important that you check the box that says "Add Python 3.x to PATH" to make sure that the interpreter will be in you execution path. This option will be in the first dialog box that appears when installing Python. 

Windows Installer Dialog Box

Note: Many macOS systems come with a version of Python. However, it's recommended that you take advantage of the latest version of Python and install this newer version alongside the system ones. There are a few different ways to get Python set up on a macOS. It is recommended that you see what's most frequently used by the people programming in your areas of interest. For example, if you're interested in using multiple versions of Python at once, you should look into using pyenv to manage installations. Another example is using Anaconda, a package manager, environment manager, and easiest way to use Jupyter Notebooks, to install Python, which is recommended if you're doing a lot of data science oriented programming. It all depends on where you want to go. 

These steps will focus on the most basic way to install Python followed by links to tutorials for install Python other ways. 

Step 1: Checking if Python is Installed

Check to see if you already have Python on your machine. This can be done by using Terminal. Open up a new terminal window, type python --version, and press enter. You should see the version of Python you have. If the number starts with a 2 followed by numbers, you will need to install the latest version of Python. Different versions are typically backwards compatible, but Python 3 and Python 2 are intentionally incompatible versions. You will need to install Python 3 if you do not have it. 

Step 2: Downloading Python

If you need to download Python, choose the most recent stable version from here: https://www.python.org/downloads/mac-osx/. You have a choice between 32-bit (labeled x86) and 64-bit (labeled x86-64) and several options for installers. Choose whatever option with which you feel most comfortable. Most recent versions for macOS don't have a 32-bit option. Don't install a 64-bit version if you have a 32-bit processor. If you end up wanting a different version, you can always uninstall Python and then reinstall the version you'd prefer .

Step 3: Running the Installer

Run the Installer. To do this, simply double-click the downloaded file and follow the dialog boxes. 

Step 4: After Installation

A Python 3.x folder should appear in you Applications folder. This will have IDLE, the development environment that is a part of official Python distributions. There are other development environments (IDEs) you can install, but it isn't necessary to use one. 

The Apple provided version of Python is installed in /System/Library/Frameworks/Python.framework and /usr/bin/python. Do not alter or delete these, as they are Apple controlled and used by software on your machine. Remember, there are now two functioning versions of Python on your computer, and it is important to keep the paths and usages consistent. 

In Terminal, you should be able to type python --version and see 3.x.x as a results. 

Other Ways to Install Python

Installing Python using Homebrew

A more complicated way to install Python, but this will ensure that the two versions of Python don't interfere with each other as well as automatically install pip, a useful package installer. 

Installing the Anaconda Distribution of Python

If you're installing Python to use it for data science, consider installing the Anaconda distribution, which also comes with a distribution of R, another programming language. 

This is for Ubuntu Linux machines. 

Step 1: Checking if Python is Installed

Check to see if you already have Python on your machine. This can be done by using a command prompt. Open up a new window, type python --version, and press enter. You should see the version of Python you have. If the number starts with a 2 followed by numbers, you will need to install the latest version of Python. Different versions are typically backwards compatible, but Python 3 and Python 2 are intentionally incompatible versions. You will need to install Python 3 if you do not have it, which is described in Step 2a. If you already have it, go to Step 2b. 

Step 2a: Downloading Python

If you need to download Python, choose the most recent stable version from here https://www.python.org/downloads/source/. You have several options for installers. Choose whatever option with which you feel most comfortable. If you end up wanting a different version, you can always uninstall Python and then reinstall the version you'd prefer .

Run the Installer. To do this, simply double-click the downloaded file and follow the dialog boxes. 

Step 2b: Updating Python Using Commands

If you are using Ubuntu 16.10 or newer, you can install Python 3.6 with the following commands:

sudo apt-get update

sudo apt-get install python3.6

 

Text Editors

What are Text Editors?

Text editors, most simply, are programs that allow you to edit text. But advanced ones can be a lot more than that. Many text editors are designed specifically around coding and come with tools that make coding easier, including auto complete functions, installable packages, and customizable themes to make reading and writing code a breeze. A good text editor, a shell, and a newer version of Python are all you really need to get started programming. Take the time to look at all the options out there and choose the one your most comfortable with. If you can't decide, it won't do any harm to have multiple text editors installed. 

 

Suggested Text Editors:

 

Text Editor Operating Systems Link Cost

Sublime Text

Highly customizable, lightweight, good shortcut capabilities

Windows, macOS, Linux https://www.sublimetext.com/ Free trial, can be purchased

Atom

Open source, downloadable packages, large community

Windows, macOS, Linux https://atom.io/ Free

Visual Studio Code

Extensible and customizable, free, support for a variety of integrations

Windows, macOS, Linux https://code.visualstudio.com/ Free

Textmate

Works with Xcode, able to generate macros and has bundles

macOS https://macromates.com/ Free

Notepad++

Free, easy to use, beginner friendly

Windows https://notepad-plus-plus.org/ Free

 

IDEs

What is an IDE?

An IDE (Integrated Development Environment) is a software application that helps computer programmers with software development. It usually consists of a source code editor (similar to a text editor), build automation tools, and a debugger. They will sometimes also have compilers or interpreters, or both, if necessary.

They often make editing code easier, as they come with features such as autocompleteeasy compiling, and easy debugging. These things are nice, but they aren't essential for programming with Python, especially if you're just getting started. They can be large and take time to download and install. A few require relatively advanced knowledge to be able to use them most effectively. 

It's recommended that you start experimenting with IDEs after you're comfortable using the command line and text editors. It's not recommended that you use IDLE (the default IDE that comes installed with Python) unless you're using it for simple things. 

Further Reading

Wikipedia - Integrated Development Environment

Codeacademy - What Is an IDE?

Real Python - Python IDEs and Code Editors (Guide) 

Suggested IDEs

GNU Emacs

This IDE has been around a long time. It can be used as just a text editor, but comes with much more. However, setting it up with Python can be tricky. Make sure you're familiar with Lisp before you start.

Vi / Vim

A very stable code editor, VIM is a modal editor. Do some research about how to set up Python and VIM before committing to this editor. 

PyCharm 

A fully featured, dedicated Python IDE. There are professional and open source versions, all of which work on Windows, macOS, and Linux platforms. This IDE has a large community dedicated to Python programming and it works with Python right out of the box. 

Spyder

If you're interested in data science, Spyder is a good way to go as it works well with common data science Python libraries. Spyder comes included with the Anaconda distribution, so if you installed Python that way you already have Spyder installed.‚Äč

 

Science and Technology Librarian

Profile Photo
Katie Wolf
Contact:
Walsh Library, Room 139
Rose Hill Campus

kwolf9@fordham.edu
718-817-4470

Reference and Digital Humanities Librarian

Profile Photo
Tierney Gleason
Contact:
Rose Hill Campus | Walsh Family Library | Room 129
tgleason11@fordham.edu
718.817.3574

Reference & Instruction Department

Reference & Instruction Department
Fordham University Libraries


Walsh Library  ♦  Rose Hill Campus  ♦  718-817-3586   
Quinn Library  ♦  Lincoln Center Campus  ♦  212-636-6050   
Fordham Westchester Library  ♦  Fordham Westchester Campus  ♦  914-367-3061 

library@fordham.edu   ♦   text 71-TXTX-1284 ♦ 
Ask a Librarian (Chat)