Python Learning notes-1

Source: Internet
Author: User

Python execution method:

  1. Entering Python on the Linux command line will enter the Python interactive environment, where you can enter a command or function for the Python language, such as exit () for exiting the interactive environment, ID () to see where the value referenced by the variable is stored in memory,

  2. Open a document with the Vim editor and enter #! in the first line /usr/bin/python, followed by the Python language, after saving the exit, add x permissions, can be used absolute path execution, or use the Python command plus the file name, at this time without the first line in the file input #! /usr/bin/python

Python file:

  1. file.py: Source code form file, open can see the source code, easy to modify

  2. FILE.PYC byte code files, compiled files, execute more efficiently, generate method: Open a file

Input

Import Py_compile

Py_compile.compile (' file.py ')

3.file.pyo optimized code file, also compiled, method: Linux command line input python-o-M py_compile file.py

Python Learning notes-1

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.