Python Learning notes Basics-python around

Source: Internet
Author: User
First, the system command

1, Ctrl+d quit Python IDLE

Enter the EOF character in the input method, type Ctrl+d

2. Command line options:

-D provides debug output

-O Generate optimized bytecode (. pyo file)

-S does not import the site module to find Python paths at startup

-V Redundant output (import statement verbose tracking)

-M modelname to run a module as a script

-Q OPT Division option

-C cmd Run Python script submitted as a command line string

File runs the Python script from the given files

Ii. development of Web sites and tools

1, Https://pypi.python.org/pypi--store the Python website centralized warehouse

Packages can be downloaded from here

2, Setuptools--based on the development of Distutils

For publishing code and PyPI interactions, you can download, build, install, upgrade, and uninstall Python packages.

3, Pycharm--ide

Third, the basic knowledge of Python

1, #! /usr/bin/env python--Used in UNIX systems, a command env, located in/usr/bin, helps the system search path to know the Python parser

2. Programming line break write using newline character \, string wrapping write using ' ' or ' ""

3. Python long integers are limited to the total virtual memory of the user's computer

4, define the function, if the return value is undefined, the default value is None, the function name with __ Identifies the default private method

5. Common built-in functions:

(1) dir ([obj]) displays a collection of properties and methods for the object, and displays the name of the global variable if the object has no parameters

(2) Help ([obj]) Displays the object's document object string in a neat and beautiful form (at the tree level), and if no arguments are provided, it enters interactive

(3) int (obj) converts an object to an integer

(4) Len (obj) returns the length of the object

(5) Open (Fn,mode) opens a file named fn in mode mode

Mode: ' R '--read ' W '-write, ' + '--Read and write

(6) Range ([Start,] stop[,step]) returns a list of integers. Start value is start default value is 0, end value is stop-1,step to step default value is 1

(7) input (str) waits for the user to enter a string that provides STR prompt information

(8) str (obj) converts an object to a string

(9) type (obj) returns the kind of object (the return value itself is a type object)

6. Common Modules

(1) SYS handles different parts of the Python runtime environment

(2) OS handling operating system-related functions

(3) Re-processing string, regular expression


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.