1. What is a variableVariable as the name implies the amount of change, the amount is a way of representing a state, and can be changed2, why to use the variableThe execution of a program is always in a state of flux, and we can use a variable to
1. Founder: Guido van Rossum2, the main application of the field:Cloud computing, Web development, scientific computers, artificial intelligence, system operations, finance, graphical GUI3, Python is a dynamic interpretation of the strong-type
Use Python to finish sending messages1, the basic information required by the mail2. Python sends mail1, the basic information required by the mailSender's server, sender, recipient (whether multiple), subject, content, whether there are attachments2
CentOS 6 comes with Python 2.6, the following records the CENTOS6 source installation Python 3.5 process#wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz#tar xf Python-3.5.2.tgz #cd Python-3.5.2#./configure --prefix=/usr/local/python3 -
Tuple, the first level element cannot be modified, cannot be added or deletedTu = (111, ' Alex ', (11,22), [(33,44)],ture,33,33,)It is recommended to add a comma at the end to distinguish whether the tuple is not an errorcan be called outTu =
Random ModuleRandom , as the name implies, is used to generate , the specific usage is as followsImport Randomlis = [1,2,3,4,5,6,7,8,9,10] #随机生成浮点数print (Random.random ()) floating-point number between #随机返回0 to print (Random.uniform (1,10))
The map () function, which receives two parameters, one is a function, the other is a sequence, and map () acts on each element of the sequence in turn, and returns the result as a new sequence;AA = [1, 2, 3, 4, 5]print ("", List (map (Lambda a:a *
Virtualenv is a tool for creating an isolated python environment. VIRTUALENV Create a folder that contains all the necessary executables to use the packages required by the Python project.InstallationPip Install VirtualenvBasic use
Create a
1.logging ModuleLevel of the 1.1logging moduleDebug debuggingInfo recordWarning potential hazardsError errorsCritical serious.1.2 Output logs in a fileImportlogginglogging.basicconfig (filename='Log.test.log', level=logging.info,#it will only be
1. Create a new test script file:2. Edit the test scriptImportUnitTestImportRequestsImportJSONImportHTMLTestRunnerur1='http://118.178.247.67:8081/systLogonUser/adminLogon.do'Headers= {'Content-type':'application/x-www-form-urlencoded','Referer':'118.
Getting started with Python read it over the internetThe key is not to useSlowly practice using a small online meeting projectpython connects to the database,Python uses version 3.6, and since the MYSQLDB module does not support python3.x, python3.x
There are 6 types of replication syntax in PythonBasic Form' spam 'Tuple Assignment' spam ' ' Ham 'List Assignmen>>>[spam, ham] = ['spam'ham']Sequence Assignment' spam 'Extended sequence Unpacking (Python 3.X)>>>a, *b ='spam'>>>a's'>>>b#b The result
The purpose of this article is to collect the simplest and most atomic blocks of code, which are simple, clear and easy to read and then set by the user. Please modify the Python code layout yourself.
Here is the index directory:1. Download
The real strong This is to find a suitable for their own way, and adhere to go on!!! Life is short, I use PythonPython is like a rich library that we don't have to know about these tools, but we have a very handy way to use it. Like refrigerators,
Python: function recursiondefinition : The function itself is called directly or indirectly in the process of invoking a function, called a recursive call. Recursive calls can call up to 999 layers.Base model:def func (): Print ('fromfunc')
Given a string, find the length of the oldest string that does not contain repeating characters.Example:Given "abcabcbb" that the oldest string without repeating characters is "abc" , then the length is 3.Given "bbbbb" , the longest substring is,
#coding: Utf-8Import OS# list all files in the current directoryFiles = Os.listdir ('. ')For filename in Files:# split file name and suffix namePortion = os.path.splitext (filename)# Compare suffix namesIf portion[1] = = ". mp3":# Modify suffix
To create a series of things, such as a project, all save points# coding = Utf-8# flask is a python-written web micro-framework that enables you to quickly implement a Web site or Web service using the Python language.From flask import Flask#
The data model talking about objectIDIn Python, all data is an object, and the object is a Python abstraction of the data. Each object has its identity,type,value. Once an object is created, its ID does not change, and you can treat it as an
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