Python Learning notes-brother Ma 2017

Source: Internet
Author: User
Tags data structures
Programming Languages

1, Users:
Problem space
2. Computer: Problem Solving
Solution Space
Abstract
Machine code-> microcode Language-> Advanced language function

Shell programming
Control Language: Glue language
Frame: Web,django
BYTE code: Bytecode Python code language first touch python run

Source code (. py)
Comolier (PVM programming virtual machine)
Bytecode (. PYc)
Interpreter (PVM execution virtual machine)
Processor Python Implementation

CPython: The way to achieve the original and standard
Jython: implementation for integration with the Java language
IronPython: Implementing Python performance optimization tools for integration with the. NET Framework

Psyco: Expansion module, algorithm optimization, replaced by pypy
Pypy:python interpreter, dynamic compiler
Shed Skin: Compilers, converting to optimized C + + code to write, execute Python code

Interactive interpreter: Start Python directly
Python Program Files (. py)
Example:

#!/usr/bin/python  #解析器
import platform    #导入python模块
print platform.uname ()  #打印uname结果

Linux Run Results:

root@kali:~/Desktop/python_pratice# chmod +x firstcode.py root@kali:~/
desktop/python_pratice#./firstcode.py
(' Linux ', ' Kali ', ' 4.3.0-kali1-amd64 ', ' #1 SMP Debian 4.3.3-5kali4 (2016-01-13) ', ' x86_64 ', ' "
root@kali:~/desktop/python _pratice#

Python programs can be decomposed into modules, statements, expressions, and objects

Idle tools:
Eclipse and Pydev
Python win
Komodo
Wingware
Pycharm Expansion:

Process oriented:
Command-centric, processing data by instructions
How to organize your code to solve problems
Object oriented:
In the data center, all the processing code is spread around the data
If the data structure is designed to organize the information and provide a quick start data structure for the processing of python process-type programming in this type of data

A collection of data elements organized together in a way that can be numbers or characters, or even other data structures;
Python's most basic data structure is a sequence; a
series of data in Python's 6: Lists, tuples, strings, Unicode strings, Buffer object and Xrange object;
key elements of Python underlying data type
Integral type: Integral (immutable Type), Boolean
floating-point type: floating-point, plural, decimal numeric
string
object Reference (variable)
Python saves all data as a memory object
in Python, the variable is actually pointing to the memory object
"=" to bind the variable name to an object in the inner, such as if the object existed beforehand, to bind directly, otherwise the referenced object is created by "="
Combining data Types
Sequence type: list []-variable sequence, tuple ()-immutable sequence, String
collection type: Collection
map type: Dictionary
logical operation type
Identity operator: is
comparison operator: <,>,<=,>=,!=,==
member Operator: In or not in
logical operator: And,or,not
Control Flow Statement
If
while
for...in
try
arithmetic operator Input/Output
Output: Python3-print () function, python2-print statement
input: input (), raw_input ()
# # #函数的创建与调用
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.