Basic Python series-Environment setup and simple input and output, python ----

Source: Internet
Author: User
Tags windows x64

Basic Python series-Environment setup and simple input and output, python ----

Python

  The following information is taken from Baidu:

Python is an object-oriented and interpreted computer programming language. It was invented by Guido van rosum in 1989 and released in 1991 as the first public release. Python has rich and powerful libraries. It is often nicknamed glue language.

Python is purely free software. The source code and interpreter CPython follow the GPL (GNU General Public License) protocol.

Install

Python installation is very simple. First download the Python installation package (Address: Python) and select the appropriate installation package based on your current system. Pay special attention to the differences in the system version. Here I chose windows x64. Because I prefer new things, I chose the latest version here. Note the following: due to the differences between Version 3 and version 3, different processing methods may be mentioned in the article, which may cause some leaks. Please submit them as soon as possible.

After the download is complete, double-click the installation package to install the package. Note that in the first step, select the following check box to avoid manual modification of system variables. After the installation is complete, open the cmd command and enter python to check whether the installation is successful. For the interface after successful installation

    

Interpreter

  The interpreter is a computer program that can directly translate and run a single line of advanced programming languages. Python interpreters are divided into many types, which are listed below:

1. CPython: After we download and install Python 3.5 from the official Python website, we will directly obtain an official version of the interpreter CPython. This interpreter is developed in C language, so it is called CPython. Running python in the command line is to start the CPython interpreter. CPython is the most widely used Python interpreter. All the code of the tutorial is also executed under CPython.

2. IPython: IPython is an interactive interpreter based on CPython. In other words, IPython only enhances the interaction mode, but the function of executing Python code is the same as that of CPython. For example, although many Chinese browsers have different appearances, the kernel actually calls IE.

3. PyPy: PyPy is another Python interpreter, which aims at execution speed. PyPy uses JIT technology to dynamically compile Python code (note that it is not an explanation), so it can significantly improve the execution speed of Python code. Most Python code can be run in PyPy, but PyPy and CPython are somewhat different, which leads to different results for the same Python code to be executed in two interpreters.

4. Jython: Jython is a Python interpreter running on the Java platform. It can directly compile Python code into Java bytecode for execution.

5. IronPython: IronPython is similar to Jython, but IronPython is a Python interpreter running on the Microsoft. Net platform. It can directly compile Python code into. Net bytecode.

Python has many interpreters, but CPython is the most widely used. If you want to interact with Java or. Net platforms, the best way is not to use Jython or IronPython, but to interact through network calls to ensure the independence of each program.

Development Tools

There are many Python development tools, and there are more searches on the Internet. I will not repeat them here. I prefer PyCharm, which is convenient, but sublime is also good and lightweight.

Input and Output  

Output: print Output is used for Versions later than 3 and lower. The only difference is that the output content must be wrapped in parentheses for Versions later than 3, but not for versions earlier than 3. For example, print ('Hello world! '). Print can accept multiple parameters. separated by commas (,), you can concatenate a string of outputs, print ('hello', 'World', 'python! '). Print will output the content in sequence, and a space will be output when a comma is encountered, so the output string is spelled like this.

Input: Python provides an input () that allows you to input strings and store them in a variable named name = input (). When we run the Python interactive command, you can enter any character and press enter to complete the input. In input, we can enter characters to prompt the user's input information, name = input ('Please input your name :');

 

End

This is some basic information about Python. For more in-depth understanding, you can refer to more detailed information. I will not go into details here. Due to time and personal problems, the update time is not fixed. Try to share your learning with you early.

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.