COP 3223H meeting -*- Outline -*- * Installing and Running the Python Interpreter ** Interpreters and Compilers ------------------------------------------ WHAT IS A PROGRAMMING LANGUAGE? def: a *language* is a set of strings def: a *programming language* is a language that is capable of expressing all computations (i.e., is Turing-complete) ------------------------------------------ ------------------------------------------ IMPLEMENTATIONS OF PROGRAMMING LANGUAGES Programs in a programming language are (generally) written in *source files*, which are files containing the text of a program. 2 general strategies: Compilers (C): translate source files into machine code, then the machine directly interprets that Interpreters (Python): read and execute the source program Intermediate approaches (Java): translate source to intermediate form (byte code) and execute that ------------------------------------------ ------------------------------------------ INTERPRETERS VS. COMPILERS (source program) -----------> output interpreter (Source program) | | compiler | v [exectuable] ----------> output machine ADVANTAGES OF COMPILERS/INTERPRETERS compilers (C) interpreters (Python) code runs ~10 times faster ------------------------------------------ ... faster development cycle programs smaller than compiled code We will see both approaches in this class. ** Downloading the Python Interpreter for your own machine In general see the running_python.shtml web page for the course, which is linked from the course web pages: www.cs.ucf.edu/~leavens/COP3223H/ ------------------------------------------ USING PYTHON ON YOUR OWN MACHINE See https://www.python.org/downloads/ Follow the directions Run IDLE exit using exit(0) or quit() ------------------------------------------ *** Windows ------------------------------------------ WINDOWS INSTALLATION DETAILS When running the installer, click on the option to add Python to your PATH Select the "Python 3.7" Start Menu folder, then click on IDLE Pin IDLE to the taskbar For command line use, run python3 ------------------------------------------ Students can see running_python.shtml for more details *** Macs ------------------------------------------ MAC INSTALLATION DETAILS After installation, use the finder: Find applications/Python 3.7 directory In that directory run IDLE (double click on it) Pin IDLE to the dock ------------------------------------------ See running_python.shtml for command line details. ** Using Python from Eustis ------------------------------------------ YOU CAN USE PYTHON AT UCF Use the eustis.eecs.ucf.edu system login: your nid password: your nid password Use a ssh client like putty (putty.org or http://www.chiark.greenend.org.uk/ ~sgtatham/putty/download.html) Run the command python3 at the shell's prompt ------------------------------------------