Interesting Python: development and deployment overview, python Overview

Source: Internet
Author: User
Tags virtual environment virtualenv

Interesting Python: development and deployment overview, python Overview

I think learning different development languages with time is helpful for maintaining a technical understanding.

Python is a simple and interesting language. There are already a lot of online materials. I will introduce several tools involved in the development and deployment environment here.

1. Install Python

This is equivalent to a runtime environment. Some documents claim that Python also has a virtual machine mechanism (after testing and comparison, its running speed is actually the same level as that of JAVA and C # compiled programs, so installing Python is the first step.

For a Windows environment, download the installation package (http://python.org /)

If it is a Linux environment (Ubuntu), it may have built-in Python, orSudo apt-get install pythonInstall

Python has two major versions: 2.x, 2.7, and 3.x. Based on the introduction in this document, the Python Foundation is designed for rapid development (without any burdens. x is not backward compatible. This is undoubtedly a bold strategy, but it is reasonable to think about it.

 

2. Install Python Package Manager (pip)

Python has a very good ecosystem. programmers all over the world can write modules (in the form of packages) for their own purposes, or for others, so there's a Python Package Index (pypi): https://pypi.python.org/pypi, as of today, there's already68178.

To use these packages well, it is best to use the installation package manager. Python has several package managers, so I will not compare them here. The mainstream Package Manager is pip. Https://pip.pypa.io/en/stable/installing/#install-pip

In Windows, install

1. Download get-pip.py

Https://bootstrap.pypa.io/get-pip.py

 

2. Install it with a command like the python get-pip.py. If you enter pip in the command line to view the following output, the installation is successful. Pip Commands include install, search, and list.

 

In the Linux environment (in Ubuntu), it is as simple as ever.

Sudo apt-get install python-pip

 

3. Multi-Version Management

Since we know that Python has multiple versions, for some purpose, we will indeed Install multiple versions on one computer. So how to better manage multiple versions (or isolate versions ). This is especially useful when deploying servers. The best tool is virtualenv. Https://pypi.python.org/pypi/virtualenv)

First, install virtualenv Through pip

Pip install virtualenv

 

Then, create a virtual environment through virtualenv, such as dev27

Virtualenv dev

It creates an isolated python environment, using Python 2.7, which contains Python programs, pip, and other tools.

Use the following command to activate the environment:

Go to the dev27 \ Scripts directory and run activate. (in Linux, you can use the source command to call activate)

To exit the current environment, run deactivate.

The following command creates a virtual environment based on Python3.4.

4. Development Environment

I think it is good to use the built-in IDLE for Python development tools.

Visual Studio also has specialized Python Tools.

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.