First, the Python characteristic +python installs the test

Source: Internet
Author: User
Tags python script

Explanatory nature

When you write a program in C or C + +, you need to compile the source code into a language that your computer can recognize (binary machine code). When these programs are run, the connector will copy the compiled program from the hard disk to the memory running.

Python:python source code does not need to be compiled into a computer can recognize the binary code run. Just run the program directly from the source code. Because when you run the source code directly, Python internally converts the source code into the middle form of the bytecode, and then translates it into a language that the computer can recognize and run.

Summary: The C language Code program runs the following steps: Compile-connect-run. The steps for Python to run are: Write code-run directly. (converted to bytecode, then to binary machine code after Python is installed, Python will be executed) so the Python source is ported to another platform to run.

Object-oriented and process-oriented

can be embedded

  If you want your algorithm details to not be exposed, you can implement the algorithm in C or C + + code and then apply it to your Python code. You can also embed python in your own program to provide scripting functionality to your program users.

Summary: C or C + + languages can be embedded with Python language.

Python installation

  Personal installation is python3.4.2, the installation process tick Pip, for the installation of other library files, such as the installation of Pymongo (this is Python connected to the MongoDB Database driver package), can be installed through the PIP. After the installation is complete, if the installation path is D:\PYTHON34, then the system variable of the environment variable, edit path, append at the back; D:\python34 adds python to the system environment variable.

Open two command lines respectively, enter Python and pip, test input correct printing information, on behalf of the successful installation.

A simple test

1 A shell test that comes with Python. Open the Python shell (IDLE) and you will see >>>, which represents the Python interpreter prompt. Enter print (' Hello python ') carriage return to output printing information.

2 Install the third-party IDE for testing. Select Pycharm here. Create a new Python project, add a. py format file, enter print (' Hello python ') alt+shift+f10 the program will run.

3 run a well-written script file (. py file) from the command line. Enter the directory where the Python script file resides, and then run the Python hello.py carriage return to execute the script code correctly. (This assumes that the new script file name is hello.py)

First, the Python characteristic +python installs the test

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.