Python on Mac OSX

Source: Internet
Author: User
Mac
OS
Python on X

In Mac
OS
X, for python Installation
There are two options: install or not install. You may want to install it.

Mac
OS
X 10.2 and later versions have pre-installed a python
Command Line version.
If you are used to using command line, you can use it to finish 1/3 of the book. However, the pre-installed version does not contain XML
Parser, so when you learn XML
You need to install the full version.

You can also install the latest full version of the GUI shell that is better than the pre-installed version.

Process 1.3. On Mac
OS
Run the pre-installed Python version on X.

Use pre-installed Python
Steps for version:

  1. Open/Applications
    Folder.

  2. OpenUtilities
    Folder.

  3. Double-clickTerminal
    Open a terminal and enter the command line window.

  4. TypePython

    .

Test:

Welcome to Darwin!
[localhost:~] you% python
Python 2.2 (#1, 07/14/02, 23:25:09)
[GCC Apple cpp-precomp 6.14] on darwin
Type "help", "copyright", "credits", or "license" for more information.
>>> [press Ctrl+D to get back to the command prompt]
[localhost:~] you%
Process 1.4. On Mac
OS
Install the latest Python version on X

The following describes how to download and install Python
Process of the latest version:

  1. From http://homepages.cwi.nl /~ Jack/macpython/download.html
    DownloadMacpython-OSX
    Disk image.

  2. Download complete. Double-clickMacPython-OSX-2.3-1.dmg
    Mount the disk image to the desktop.

  3. Double-click the installerMacPython-OSX.pkg
    .

  4. The installer prompts your administrator username and password.

  5. Follow the prompts of the installation program.

  6. After installation, close the installer and open/Applications
    Folder.

  7. OpenMacPython-2.3
    Folder.

  8. Double-clickPythonide
    To run Python
    .

Macpython
IDE
A pop-up screen will show you in the interactive shell. If the interactive shell does not appear, select Window
-> Python interactive
(CMD

-0


). You will see information similar to the following:

Python 2.3 (#2, Jul 30 2003, 11:45:28)
[GCC 3.1 20020420 (prerelease)]
Type "copyright", "credits" or "license" for more information.
MacPython IDE 1.0.1
>>>

Note that the pre-installed version still exists once the latest version is installed. If you run the script from the command line, you need to know which version of python is in use
.

Example 1.1. Two Python
Version
[localhost:~] you% python
Python 2.2 (#1, 07/14/02, 23:25:09)
[GCC Apple cpp-precomp 6.14] on darwin
Type "help", "copyright", "credits", or "license" for more information.
>>> [press Ctrl+D to get back to the command prompt]
[localhost:~] you% /usr/local/bin/python
Python 2.3 (#2, Jul 30 2003, 11:45:28)
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits", or "license" for more information.
>>> [press Ctrl+D to get back to the command prompt]
[localhost:~] you%

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.