Introduction to Computer Programming - CSCI-UA.0002 - Summer 2017

Installing Python 3 and IDLE

You'll need to install a Python for this class (because, you know, that's what we're programming in)!

🐍🐍🐍🐍


Alternatives to IDLE (Other Text Editors)


PyCharm

Using Sublime Text 2 with Python 3

Overview

Sublime text uses "build systems" to let you run files through external commandline applications. One use for this is to run your code through the Python interpreter!

Sublime Text 2 already comes with a Python build, but it uses your system's Python, which is most likely 2.x. If you've installed Python 3 side-by-side with your system Python, you can create a build specifically for Python 3.

Instructions

(note that these instructions are osx specific; you may not need the "path" line in the configuration for windows)

sublime1

{
	"cmd": ["python3", "-u", "$file"],
	"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
	"selector": "source.python",
	"path": "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
}

sublime2

Usage

From here on, you can use ⌘ + b (or Tools → Build) to run your Python 3 programs

Verification

import sys
print(sys.version)
3.2.3 (v3.2.3:3d0686d90f55, Apr 10 2012, 11:25:50) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
[Finished in 0.1s]

CSCI-UA.0002 - Introduction to Computer Programming - Summer 2017