Look carefully at the files. Then if you are on a mac go Cmd+Shift - search and open terminal - then typeYour First Program in Python 2 on Mac OS XMac OS home directory with secret files displayed. (Its OK to delete the /Users/yourusername/Downloads/introcs-python.zip file after you have unzipped it.)First create a python file called texteditor.py or something like that. In the Mac Finder, double-click on /Users/yourusername/Downloads/introcs-python.zip to unzip the file, thus creating the /Users/yourusername/Downloads/introcs-python directory containing the booksite example programs.We allow you to open and edit your text files online with our free software.This page tells you how to setup a Python programming environment for your Mac OS X computer and provides a step-by-step guide for creating and running a simple "Hello, world" Python program. Zshrc with any text editor app, simply open up your home directory in Finder.TextPad is an award winning text editor for browsers, Edit Pad is a simple. Zshrc with TextEdit (or any text editor) To create. Choose one of the two ways below to create this file.
Create A File In Python In Textedit Mac OS XMac OSType some text into this document. Launch TextEdit, and create a New Document. Create Files in TXT Format on Mac: Editing the Preferences 1. These instructions are for MacOS X 10.13 (High Sierra), but the instructions for other versions of Mac OS X are similar.Save text file Mac How to Save Files in TXT Format in TextEdit on Mac Beebo. IDLE, the Python Integrated Deve Lopment Environment. Python, that is, the Python compiler/interpreter. The Python programming environment required by this booksite consists of:Making multiple changes at once, swapping pieces of code, and a lot more is made trivial with TextMates easy way to add multiple insertion points. Now, go to File -> Save , or press. Quicken 2014 for mac downloadIt's fine to use that version. The Terminal application that is bundled with Mac OS X.Downloading and Installing Python, IDLE, Tkinter, NumPy, and PygameA version of Python 2 is bundled with Mac OS X. The booksite library, that is, a set of modules that we developed specifically to support this booksite. Enter your computer's administrator password when prompted:In the Terminal window issue this command to use pip to install Pygame:Perform these steps to test your environment:In the Terminal window issue the python command. (It has the appearance of a magnifying glass.) In the resulting dialog box, type Terminal.app followed by the Enter key.In the Terminal window issue these commands to install pip, the Python package manager. To do that, click on the Spotlight Search icon on the right end of the menu bar. In the Terminal window issue the cd Downloads command to change your working directory to /Users/ yourusername/Downloads, and then issue the cd introcs-1.0 command to change your working directory to /Users/ yourusername/Downloads/introcs-1.0. Initially the working directory is /Users/ yourusername. This document instead uses the equivalent Unix term directory.In the Finder, double click on the /Users/ yourusername/Downloads/introcs-1.0.zip file to unzip the file, thus creating a directory named /Users/ yourusername/Downloads/introcs-1.0.At any time the Terminal application has a working directory. If Python generates no error messages, then you have installed Pygame properly.At the Python > prompt, type exit() followed by the Enter key to exit Python.Downloading and Installing the Booksite LibraryPerform these steps to download and install the booksite library:Use your Web browser to download this introcs-1.0.zip file to your /Users/ yourusername/Downloads directory.Note: The Mac Finder application uses the term folder to mean a container of documents and, perhaps, other folders. Virtual box pc emulator for macFollow these instructions:In the Terminal window issue the command idle to launch IDLE.Click on the Python → Preferences. You should perform one more step before creating your first program: configure the IDLE programming environment. If Python generates no error messages, then you have installed the booksite library properly.So far you've downloaded and installed all of the software that you'll need. The computer copies the files defining the booksite modules to a directory where Python can find them, and writes status messages to your Terminal window to indicate its progress.Perform these steps to test your installation of the booksite library:In the Terminal window issue the python command.At the Python > prompt, type the statement import stdio followed by the Enter key. Make sure that a file named setup.py is in your working directory.Issue the python setup.py install -user command. Be careful the smallest typing mistake might cause the program to fail.# Write 'Hello, World' to standard output.When you are finished typing, in IDLE click on the File → Save. Use the Delete key to delete text. Use the arrow keys, mouse, or touchpad to move within the text that you have typed. The trailing ampersand tells the computer to run the idleX program in the background, thereby leaving your Terminal application free to handle additional commands while IDLE is running.In IDLE, type the four-line Python program helloworld.py exactly as it appears below. Note the trailing ampersand. Perform these instructions:Using the Finder, create a directory named /Users/ yourusername/hello.Issue the cd hello command to make the /Users/ yourusername/hello directory your working directory.Issue the command idle & to launch IDLE. ![]() ![]() Confirm that the working directory contains a file named bouncingball.py.Issue the python bouncingball.py command. (It's OK to delete the /Users/ yourusername/Downloads/introcs-python.zip file after you have unzipped it.)Then perform these steps to test your download of the booksite example programs:Issue the cd Downloads and cd introcs-python commands to make /Users/ yourusername/Downloads/introcs-python your working directory.Issue the ls command. Perform these instructions:Use your Web browser to download this introcs-python.zip file to your /Users/ yourusername/Downloads directory.In the Finder, double-click on the /Users/ yourusername/Downloads/introcs-python.zip file, thus creating the /Users/ yourusername/Downloads/introcs-python directory containing the booksite example programs. Having done so, you can run those programs to help you learn about them. Congratulations! You are a Python programmer!Downloading the Booksite Example Programs (optional)We recommend that you download the booksite example programs, that is, the example Python programs that are presented incrementally throughout the booksite. Perform these instructions:Use your Web browser to download this stdlib-python. Now we describe how to download the booksite library so you can find it — for the sake of studying the code that implements it, should you so desire. (It's OK to delete the /Users/ yourusername/Downloads/introcs-data.zip file after you have unzipped it.)Downloading the Booksite Library: Part 2 (optional)Previously on this page we described how to download and install the booksite library so Python can find it. Perform these instructions:Use your Web browser to download this introcs-data.zip file to your /Users/ yourusername/Downloads directory.In the Finder, double-click on the /Users/ yourusername/Downloads/introcs-data.zip file, thus creating the /Users/ yourusername/Downloads/introcs-data directory containing the booksite example data files.
0 Comments
Leave a Reply. |
AuthorAndy ArchivesCategories |