Python installation configuration and Operation-mac

Source: Internet
Author: User

Download installation

Open the terminal or item2 to see if Python is installed. The OS comes with Python, but the version is rather old.

Install via homebrew (AppStore for development software): View homebrew and Python documentation

    1. Search Python brew search Python to see the Python version first
    2. Type the command brew install Python3 installation Python3
    3. After the installation is complete, type python-v to see if the installation was successful.

You need to turn on VPN,PIP and Setuptools also install at the same time:

Official Download Install : https://www.python.org/downloads/mac-osx/, some trouble. Recommended homebrew installation.

Three ways to run Python:1, interactive interpreter:

The command-line window enters Python and starts writing Python code in the interactive interpreter.
Python coding can also be done in Unix,dos or any other system that provides a command line or shell.

$python # unix/linux# or python% # Unix/linux

The following are the Python command-line parameters:

    • -D displays debug information at parse time
    • -O Generate Optimization code (. pyo file)
    • -S does not introduce a location to find Python paths when booting
    • -V Output Python version number
    • -X is obsolete based on the built-in exception (for strings only) since version 1.6.
    • -C CMD executes the Python script and runs the result as a CMD string.

File executes the Python script in the given Python file.

2. Command line script

In your application, you can execute a python script on the command line by introducing an interpreter, as follows:

$python script.py # unix/linux# or python% script.py # Unix/linux

Note: When executing a script, check to see if the script has executable permissions.

3. IDE for integrated development environment

Pycharm:

Python installation configuration and Operation-mac

Related Article

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.