This section outlines:
Modules and Packages
Time &datetime Module
Random
Os
Sys
Shutil
JSON & Picle
Shelve
XML processing
YAML processing
Configparser
Hashlib
Subprocess
Logging module
One: Print statementPrint statements can be printed out. Where the concatenation of strings is used instead of +, which is different from Java.print ' Hello ', ' world '--printing Hello WorldTwo: NotesPython is annotated with #, such as: #print '
The program can implement the following functions:1, query, input select Name,age from staff_table where > 22, query to meet the requirements of the information;Enter SELECT * FROM staff_table where dept = "IT" to query for information that meets
Python only function no processfunction has a return value after it has run out, the procedure does notDef back ():Return 1, ' GG ', 2 #会有返回值 (1, ' GG ', 2) #注意默认返回元祖First, global and local variablesIn the function to change the value of the global
This section is about exception exceptContinue with the code from the previous section. It's good for me to make a mistake in the name word. Then add an exception capture at the end of the section:Try: handler=open ("12.txt") #在这里我特别将文件的名字搞错 for
Preliminary study on Day0:pythonGuideLanguage is divided into static language and dynamic language(1) The static language requires that you declare the type of each variable : How much memory it will use, and the allowed usage. Computers use this
1, Module IntroductionMany functions are grouped by category and placed in separate files. In Python, a. py file is called a module. In other languages, it is called a class library.What are the benefits of using modules?(1) Greatly improve the
Python--Shell:Reference articles1. Environment variablesImport os var= 123 or var= ' 123' os.environ[' var ']=str (Var) #environ key value must be a string os.system (' echo $var ') 2. String connectionImport os path= '/root/a.txt ' var=[1]
Use of web cookiesCookies, which are data stored on the user's local terminal (usually encrypted) by certain websites in order to identify users and perform session tracking.# The concept of openerWhen you get a URL you use a opener (a urllib2.
C:\Python27\Lib\ConfigParser.py:Optionxform (self, optionstr): Return Optionstr.lower ()Changes the option name in the configuration file to lowercaseIn order to preserve the case format of the configuration item name, override:class myconf (
Matplotlib1, installation Matplotlib① Linux System# Install Matplotlib module $ sudo apt-get install python-matplotlib# if it is python2.7 execute the following command $ sudo apt-get install python-matplotlib# if you Install newer python, install
JsonData exchange between different platforms (typically different languages)Vim day6-1.py#!/usr/bin/python#-*-coding:utf-8-*-import jsonname = { ' alex ': [+, ' M '], ' rain ': [+, ' F ']}name_after_ Transfer = Json.dumps (name) print
This article mainly introduces the example of using the item () method in Python to traverse a dictionary, for...in this is the most common way to traverse a dictionary in Python, the need for friends can refer to the following
There are several
This paper mainly introduces the method of simple image processing using Python and the example of Python auto-production expression pack, which has a good reference value, and then we can see it together with the small series below.
As a data
Python the random module in is used to generate a stochastic number. Here are some of the most commonly used functions in the random module. 1.random.randomRandom.random () is used to generate a random number of 0 to 1 Points: 0 2.random.uniformThe
Use itertools to solve the problem of unordered arrangement and combination.
Recently I started to fight for Codewars as a Python rookie, so I plan to write down the interesting questions here. Today's first question is "Best Travel ":
John and
Start learning Python ~~, Learn Python ~~
My life is short. I use Python!
Origin: Netherlands
ASCII Code: American Standard Code for Information Interchange
All data is stored and computed in Binary Notation (because the computer uses high voltage
Python entry-level: Class and Class inheritance; python entry-level inheritance
Class is the sum of abstract concepts with common features and behaviors.
1. Define a class:
We use class to define a class, which is similar to definition function def.
Python development [module]: matplotlib draw line chart, pythonmatplotlibMatplotlib
1. Install matplotlib
① Linux Installation
# Install the matplotlib module $ sudo apt-get install python3-matplotlib # If it is python2.7 execute the following
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