This week, Python has begun to learn, feeling python similar to PowerShell, but with different points. Summarize the newly-learned information here;
A simple way to use variables:
Name= input ("Input your Name:")age= int (Input ("Input your
Module
The function of a module is to reuse code blocks, such as functions, properties, and classes.
Import Module
The import of a module is imported once, and a. pyc file is generated after the first import, and if it is imported
In the Pycharm ...When two py files are in the same folder. Directly from the file name import * canWhen two files are in a different folder. You need to include the _init_.py file in the file. There is nothing to write about. But this file is
The dictionary is the only built-in mapping type in Python. (Mappings are data structures that refer to values by name).The values in the dictionary are not in a special order, but are stored in a specific key. Keys can be numbers, strings, and
Timer Wheel FinderDOCTYPE HTML>HTMLLang= "en">Head> MetaCharSet= "UTF-8"> title>Titletitle>Head>Body>DivID= "a">Welcome to Beijing, for your epochDiv>Script> functionfunc () {//Z Gets the contents of the label based on the ID
ReflectionReflection: The effect of reflection is to increase the readable line of code.__import__ the difference between Import module and import module:The __import__ import module is imported through a string. Import is a common method of
The paging interaction is synchronous and asynchronous when the data is requested, while the whole page refreshes when synchronizing, and the page is refreshed asynchronously. For these two paging data in the crawler, the manner of processing is not
Explain the Python operation database, complete the simple deletion and modification work, take MySQL database as an example.
Python's MySQL database operation module is called MYSQLDB, which requires additional installation.
Install via PIP tool:
#coding =utf-8
#/usr/bin/env python
Import xlsxwriter,xlrd
Import sys,os.path
fname = ' zm6.xlsx '
If not os.path.isfile (fname):
print u ' file path does not exist '
sys.exit ()
data = Xlrd.open_workbook (fname) # open fname
Python basic learning notes (s t r method on the third day), python learning notes
Seven important functions
# '_'. Join ("as") concatenates each element in the string according to the specified separator# Split remove a specified string for
About django authentication and logon, and about django Authentication
Authenticated Login
Django. contrib. auth provides many methods. Here we mainly introduce three of them:
1 authenticate (** credentials)User authentication is provided to verify
Summary of several methods for Django to accept front-end data.
Background
The test toolbox is half written. Today, we have encountered a problem of data interaction between the front and back ends.
Environment
---------------------------------------
The python loop statement is different from other programming languages.
1. Local Variables
for i in range(5): print i,print i,
Running result:
0 1 2 3 4 4
I is the local variable in the for statement. However, in python, a local variable is
Configure the EditPlus editor to make it an editing and execution environment for Python, editpluspython
1. Add a Python Group
Run EditPlus, select Tools → configure user tools to enter the parameter settings box.
Click Add tool> application.
Copy and deepcopy, pythondeepcopy
1. Normal assignment copy:
It can be found that B and a have the same id,
When a changes, B changes accordingly.
2. Shallow copy:
At this time, the two IDs are different. When the shortest copy occurs,
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