Directory
Python_ Basic Summary 1 Python Origin character encoding comment pyc file python variable import module get user input flow control if while
Python basic 2 encoding conversion pycharm configuration operator basic data type int
Import Os[[email protected] ~]# Python3python 3.5.1 (default, May, 00:36:44) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] On Linuxtype ' help ', ' copyright ', ' credits ' or ' license ' for more information.>>> import os >>> os.system ("df-th") file
First blog, do not spray! No special declarations will be made under python3.5.The most fundamental differences between 1.python2 and Python31.printThe biggest difference between Python2 and Python3 in the beginner's eyes is print, and I'll show it
IndexThe index in Python is from 0 the beginning, so the index 0 corresponds to the first element of the sequence 1 . To get 5 the first element, you need to use the index value 4 .In addition to the forward index,Python introduces the use of
Generally, calling a function is a parenthesis. If you see a parenthesis followed by a parenthesis, the first function returns a function, and if there are parentheses, the previous one also returns a function. And so onLike Fun () ()def Fun ():
1. String judgmentsStr.isalnum () returns: True, all letters or numbersStr.isalpha () returns: True, all lettersStr.isdigit () returns: True, all numbersStr.istitle () returns: True, the first letter is uppercaseStr.isspace () returns: True, all
DescribeThe index () function is used to find the index position of the first occurrence of a value from the list.GrammarIndex () method syntax:List.index (obj) Parameters
Obj--the object to find.
return valueThe method returns the index
In a regular expression, group () is used to present a string that is intercepted by a packet , () to groupImport rea = "123abc456" Print Re.search ("([0-9]*) ([a-z]*] ([0-9]*)", a). Group (0) #123abc456, return to overall print re.search (" ([0-9]
Just so I have a PNG picture need to be evenly cut, just I do not PhotoShop, just I want to use Python to practice practiced hand.So the sleeve code script.ImportOS fromPILImportImagedefsplitimage (SRC, rownum, Colnum, Dstpath): IMG=Image.open (SRC)
Lambda function:in a lambda statement, the colon is preceded by a parameter, can have multiple, separated by commas, and the return value to the right of the colon1. Map/reduce function(1)map()The function receives two parameters, one is a function,
User Registration and email verification methods in Django, django User Registration
This article describes how to register an article using Django. First, let's talk about the overall logic:
• Process user registration data,
• Generate token,
Python3 uses requests to log on to Renren's video website, python3requests
I have long heard that the requests library is powerful, but I haven't touched it yet. Today I have touched on it and found that urllib, urllib2, and other methods used in
Python data types (4) dictionary: dict, pythondict
I. Basic Data Types
Integer: intString: str (Note: \ t is equal to a tab key)Boolean value: boolList: listList []Ancestor: tupleAncestor use ()Dictionary: dict
Note: All data types exist in the
Python installation and use command line Interaction module pexpect basic tutorial, pythonpexpect
I. Installation1. Install the easy_install Tool
wget http://peak.telecommunity.com/dist/ez_setup.py
Python ez_setup.py install the easy_install tool
Python downloads a specified page slice,
This example describes how to download a specified page in Python. We will share this with you for your reference. The details are as follows:
#! /Usr/bin/python # coding: utf8import reimport urllibdef
Django 1.9.6 official documentation Part 2 (Chinese translation), django1.9.6
Note: I recently started to learn the Python Django framework. To urge me to learn and force myself to translate official documents, it is both a learning and accumulation!
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