Python Foundation Day01

Source: Internet
Author: User

Python Course notes

"I" Areas of application
(1) Cloud computing: OpenStack
(2) Web development: watercress, Django
(3) Scientific computing, artificial intelligence: Pandas
(4) System operation and maintenance
(5) Financial
(6) Graphical GUI

"II" features
(1) Compiled language: C, C + +
Need to compile, run faster

(2) interpreted language: Python
Platform compatibility

(3) Dynamic language: Python
Run time, detect
Data type does not have to be declared

(4) Static language: C, C + +, Java
Compile-time, detect
Data type requires pre-use declaration

(5) Strong data type
Data type, can only be cast
Type-Safe language

(6) Weak data type
A variable can give values of different data types

Summary: Python is a dynamically explanatory, strongly typed definition language.

"III" Pros and cons
Advantages:
(1) Simple positioning
(2) High development efficiency: third-party libraries
(3) Advanced language
(4) Portability: other platforms
(5) Extensibility: Algorithms, speed written in other languages
(6) Embeddable: C, C + +
Disadvantages:
(1) Slow speed
(2) code cannot be encrypted
(3) thread cannot use multi-CPU

"IV" Interpreter
(1) CPython: for the widest
(2) PyPy: Using JIT technology, fast execution speed
(3) Jython

"V" Learning recommendations
(1) 1991, Python was born
(2) python2.7,2010 July 3
Note: Support to 2020
(3) python3.5, September 13, 2015
Note: Python 3.4+ is recommended

"VI" Python 2.x and Python 3.x
(1) Print usage
(2) library names from uppercase to lowercase, e.g. from queue to Queue,socketserver to Socketserver
(3) underline that the name of the library is removed
(4) Python 2.x default is ASCII encoding, the default does not support Chinese characters, can specify the encoding form;
(5) Python 3.x default Unicode encoding, default support kanji
(6) Input raw_input (Python 2.x), input (Python 3.x)
(7) Python 3.x network transmission, can only be used in binary form, but Python 2.x can be used in binary, string
Note: Twisted temporarily does not fully support Python3

"VII" Python Installation
(1) Windows
Download the installation package, install it by default, and then configure environment variables
"Right-click Computer"-"Properties"-"Advanced system Settings"-"Advanced"-"Environment variable"-"in the second content box to find the variable named path of a row, double-click"-"Python installation directory appended to the variable value, with;
(2) Linux, Mac
No installation Required

"VIII" Hello World program
(1) execution in the interactive device
Print ("Hello World")

(2) Documents
Vim hello.py
#!/usr/bin/env python
#-*-Coding:utf-8-*-

Print ("Hello World")

(3) Implementation
Python hello.py







Python Foundation Day01

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.