hashlib, md5 module random module types module atexit module

hashlib, md5 module: 

. hashlib.md5 ( 'md5_str') hexdigest () specified string md5 encryption 
. md5.md5 ( 'md5_str') hexdigest () specified string md5 encrypted 

random module: 

random.random () generated random floating point numbers 0-1 
random.uniform (a, b) generating random floating point numbers within the specified range 
random.randint (a, b) generating random integers within the specified range 
random.randrange ([start], stop [ , step ]) random number is generated from a set of specified step length 
random.choice (sequence) from a random number sequence 
random.shuffle (x [, random]) will be a list of elements upset 
random.sample (sequence, k) acquiring the specified length of the random sequence from the fragment 

types module: 

stores all the data type name. 
type IF ( '1111') == types.StringType: 
MySQLdb Module: 
MySQLdb.get_client_info () Get API version 
MySQLdb.Binary ( 'string') into binary data 
MySQLdb.escape_string ( 'str') characters turn for the mysql defined function
MySQLdb.DateFromTicks (1395842548) time stamp into datetime.date object instance
MySQLdb.TimestampFromTicks (1395842548) time stamp into datetime.datetime object instance 
MySQLdb.string_literal ( 'str') character escapes 
MySQLdb.cursor () method on the cursor object: "python core programming" P624 

atexit module: 

atexit.register (fun, args, args2 ..) registration function func, this function is called before interpreter exits 
--------------------- 
author: changaspl 
source: CSDN 
original: https://blog.csdn.net/qq_40674583/article/details/81940974 
Disclaimer: This article is a blogger original article, reproduced, please attach Bowen link!

  

Guess you like

Origin www.cnblogs.com/heluobing/p/10963830.html