This section outlines:
Module Introduction
Time &datetime Module
Random
Os
Sys
Shutil
JSON & Picle
Shelve
XML processing
YAML processing
Configparser
Hashlib
Subprocess
Logging module
1.map () is a Python built-in high-order function that receives a function f and a list, and then, by putting the function f on each element of the list in turn, gets a new list and returns.Assuming that the user entered the English name is not
Reference Links:Python writing simple Trojan Horse programRefer to this blog to writeA few specific questions:1. Configure the Pyhook module, cTYPES module, which requires these two pieces of wood to run successfully.2. Combine the three modules to
1. The concept of stream. Data exchange usually requires the establishment of two "water pipes".2, synchronous IO and asynchronous IO. Asynchronous performance is high, but the programming model is complex.3, Operation IO function is provided by the
Remove illegal characters contained in list Val_list, Illegal_char is a list of illegal charactersDef clear (): Illegal_char = [' ', ' # ', '% ', ' _ ', ' @ '] Tmp_list = [] Val_list = [' Aaaaaaaa a A a 1%dddd%[email protected]@@@@@111 #1
This article is divided into six major categories:
About Python
Data type
Print statement
Comments
Variable
String
First, Python introduction: python Features: Elegant, clear, concisePython for development:
About function objects and closuresClosure (closure) is an important grammatical structure of functional programming. Different languages implement closures in different ways. Python is based on a function object and provides support for the
#_*_ coding:utf-8 _*_ImportNumPy as NP#Create an arrayA=np.array ([[1.,7.,0.],[-2.,1.,2.]])Printa#Main properties of Ndarray:#number of Ndarry.ndim array rowsPrintA.ndim#Naarray.shape: Number of array dimensionsPrintA.shape#ndarry.size: Total number
Time.time () gets the current timestampFor example:#!/usr/bin/-*-coding:utf-8-*-import time ; ="Current timestamp is:", ticksResults:The current timestamp is: 1491750320.74Time tupleFor example, get the current time:# !/usr/bin/python #
Os.path is an internal component of Python that is used to manipulate file names and parse file name strings.Some variable names are defined in the OS module to help deal with the file name in the following variables.Os.sep: File delimiterOs.pardir:
Install PythonUse Python to manipulate Excel tables.1. Download the XLRD package (module), then unzip and copy to the installation Python path under python2.7/lib/.2. Install the XLRD package: Enter the python2.7/lib/xlrd-1.0.0/directory, use the
Job Requirements:1. User input account password to login2. The user information is saved in the file3. User password input error three times after locking the user4. Locked users The next login directly prohibit loginAccording to the teacher's
1, first of all to define two files, one is a user file, one is a blacklist file, I use the user's file in the pre-defined user name and password to implement the input three times the wrong user name to lock the user, and then add a blacklist.
Before the winter break, I learned the basics of Python. Getting started with Python on the Web: http://www.imooc.com/learn/177Python Advanced: http://www.imooc.com/learn/317In fact, a lot of knowledge is to learn to forget, forget to learn.Recently,
The previous time is crawling text, recently ready to crawl picturesTwo ways to save files have been foundOne is to use the Urllib.urlretrieve method#-*-coding:utf-8-*-import urllibdef callbackfunc (Blocknum, BlockSize, totalsize): "' Callback
Python provides some interesting and useful functions, such as any all zip, which greatly simplifies our code and can handle iterative objects more gracefully, while at the same time you have to be aware of some situationsAny
any(iterable)
First week of python, first week of school
Main application fields of PythonCloud computing, scientific computing, WEB development, graphic GUI1. What is the voice of Python.The differences between the compilation language and the Interpretation
Write a snake in Python and a snake in Python.
I recently learned Python and want to do something to train my hands. The command line greedy snake is generally a C practice program, but I can't find anything else at the moment. I want to practice
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