Python 常用模块总结

常见的模块

  • random
  • math
  • datetime
  • time
  • os
  • os.path
  • sys
  • hashlib
  • hmac
    … …

模块的导入

>>> import os
>>> import hashlib [as hash]
>>> import http.server [as ser]
>>> from http import client [as cli]  

1、random

作用:产生随机数

>>> import random
>>> dir(random)
['betavariate', 'choice', 'choices', 'expovariate', 'gammavariate', 'gauss', 'getrandbits', 'getstate', 'lognormvariate', 'normalvariate', 'paretovariate', 'randint', 'random', 'randrange', 'sample', 'seed', 'setstate', 'shuffle', 'triangular', 'uniform', 'vonmisesvariate', 'weibullvariate']
>>> random.randint(5, 10)      # 产生5--10之间的整数
8
>>> random.random()            # 产生0--1之间的整数
0.2718111326910797
>>> random.uniform(5, 10)      # 产生一个范围的正态分布的数
7.911538309334022
>>> ls = ['hello', 123, True, 4533]
>>> random.choice(ls)          # 在序列(seq)中随机筛选一个元素
'hello'

2、math

作用:用于数学计算

>>> import math
>>> dir(math)
['acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'comb', 'copysign', 'cos', 'cosh', 'degrees', 'dist', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'inf', 'isclose', 'isfinite', 'isinf', 'isnan', 'isqrt', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'log2', 'modf', 'nan', 'perm', 'pi', 'pow', 'prod', 'radians', 'remainder', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau', 'trunc']
>>> math.ceil(3.0000000001)   # 向上取整
4
>>> math.floor(3.0000000001)  # 向下取整
3 
>>> math.fabs(-7)             # 求绝对值
7.0
>>> math.fmod(10, 3)          # 求模
1.0
>>> math.isnan(1)             # 判断一个数不是数字
False
>>> math.isfinite(5)          # 判断是否为数字(整数/浮点数,有限,无限或NaN),则返回True既不是无穷大也不是NaN(不是数字),否则返回False 
True
>>> math.isfinite(math.e)
True          
>>> math.pi                   # 取圆周率
3.141592653589793
>>> math.e                    # 自然常数
2.718281828459045 
>>> math.pow(2, 3)            # 幂次方运算
8.0
>>> math.sqrt(7)              # 开平方根
2.6457513110645907

3、os

作业:操作系统文件系统

>>> dir(os)
['abc', 'abort', 'access', 'add_dll_directory', 'altsep', 'chdir', 'chmod', 'close', 'closerange', 'cpu_count', 'curdir', 'defpath', 'device_encoding', 'devnull', 'dup', 'dup2', 'environ', 'error', 'execl', 'execle', 'execlp', 'execlpe', 'execv', 'execve', 'execvp', 'execvpe', 'extsep', 'fdopen', 'fsdecode', 'fsencode', 'fspath', 'fstat', 'fsync', 'ftruncate', 'get_exec_path', 'get_handle_inheritable', 'get_inheritable', 'get_terminal_size', 'getcwd', 'getcwdb', 'getenv', 'getlogin', 'getpid', 'getppid', 'isatty', 'kill', 'linesep', 'link', 'listdir', 'lseek', 'lstat', 'makedirs', 'mkdir', 'name', 'open', 'pardir', 'path', 'pathsep', 'pipe', 'popen', 'putenv', 'read', 'readlink', 'remove', 'removedirs', 'rename', 'renames', 'replace', 'rmdir', 'scandir', 'sep', 'set_handle_inheritable', 'set_inheritable', 'spawnl', 'spawnle', 'spawnv', 'spawnve', 'st', 'startfile', 'stat', 'stat_result', 'statvfs_result', 'strerror', 'supports_bytes_environ', 'supports_dir_fd', 'supports_effective_ids', 'supports_fd', 'supports_follow_symlinks', 'symlink', 'sys', 'system', 'terminal_size', 'times', 'times_result', 'truncate', 'umask', 'uname_result', 'unlink', 'urandom', 'utime', 'waitpid', 'walk', 'write']
>>> os.system('cls')                       # 执行操作系统命令
0
>>> os.curdir                              # 返回当前目录(相对)
'.'
>>> os.path.abspath(os.curdir)             # 返回当前目录(绝对)
'C:\\Windows\\system32'
>>> os.chdir("C:\\ProgramData\\NVIDIA")    # 切换工作目录
>>> os.path.abspath(os.curdir)
'C:\\ProgramData\\NVIDIA'
>>> os.cpu_count()                         # 统计计算机cpu线程数
8
>>> os.getcwd()                            # 返回当前绝对路径
'C:\\ProgramData\\NVIDIA'
getpid()			                       # 获取当前进程的进程编号
getppid()		                           # 获取当前进程的父进程的编程
kill()			                           # 通过进程编号杀死进程
>>> os.linesep                             # 查看操作系统换行符
'\r\n'
>>> os.listdir()                           # 查看当前目录下文件夹以及文件
['.jetbrains', 'AccountPictures', 'Desktop', 'desktop.ini', 'Documents', 'Downloads', 'Foxit Software', 'Libraries', 'Music', 'Nwt', 'Pictures', 'SogouInput', 'Thunder Network', 'Videos']
>>> os.mkdir("C:\\Users\\Public\\wan")     # 创建目录,仅支持创建一层目录
>>> os.makedirs("C:\\Users\\Public\\wan\\a\\b\\c\\d")      # 创建目录,仅支持递归创建
open()								     # 打开文件
>>> os.pathsep                            # 查看系统环境变量分隔符
';'
>>> os.sep                                # 查看系统路径的分隔符
'\\'
>>> os.remove("wan.txt")                  # 删除指定文件
>>> os.removedirs('wan')            	  # 删除指定目录(支持多级删除)

4、os.path

作用:用于获取文件的属性

>>> import os.path as p
>>> dir(p)
['abspath', 'altsep', 'basename', 'commonpath', 'commonprefix', 'curdir', 'defpath', 'devnull', 'dirname', 'exists', 'expanduser', 'expandvars', 'extsep', 'genericpath', 'getatime', 'getctime', 'getmtime', 'getsize', 'isabs', 'isdir', 'isfile', 'islink', 'ismount', 'join', 'lexists', 'normcase', 'normpath', 'os', 'pardir', 'pathsep', 'realpath', 'relpath', 'samefile', 'sameopenfile', 'samestat', 'sep', 'split', 'splitdrive', 'splitext', 'stat', 'supports_unicode_filenames', 'sys']
>>> p.abspath('.')               # 返回路径的绝对路径
'C:\\Users\\DELL'
>>> p.realpath('.')              # 返回路径的绝对路径
'C:\\Windows\\System32'
>>> help(p.altsep)               # 用来查看python中各种符号
Operator precedence
*******************

The following table summarizes the operator precedence in Python, from
lowest precedence (least binding) to highest precedence (most
binding).  Operators in the same box have the same precedence.  Unless
the syntax is explicitly given, operators are binary.  Operators in
the same box group left to right (except for exponentiation, which
groups from right to left).

Note that comparisons, membership tests, and identity tests, all have
the same precedence and have a left-to-right chaining feature as
described in the Comparisons section.

+-------------------------------------------------+---------------------------------------+
| Operator                                        | Description                           |
|=================================================|=======================================|
| ":="                                            | Assignment expression                 |
+-------------------------------------------------+---------------------------------------+
| "lambda"                                        | Lambda expression                     |
+-------------------------------------------------+---------------------------------------+
| "if""else"                                   | Conditional expression                |
+-------------------------------------------------+---------------------------------------+
| "or"                                            | Boolean OR                            |
+-------------------------------------------------+---------------------------------------+
| "and"                                           | Boolean AND                           |
+-------------------------------------------------+---------------------------------------+
| "not" "x"                                       | Boolean NOT                           |
+-------------------------------------------------+---------------------------------------+
| "in", "not in", "is", "is not", "<", "<=", ">", | Comparisons, including membership     |
| ">=", "!=", "=="                                | tests and identity tests              |
+-------------------------------------------------+---------------------------------------+
| "|"                                             | Bitwise OR                            |
+-------------------------------------------------+---------------------------------------+
| "^"                                             | Bitwise XOR                           |
+-------------------------------------------------+---------------------------------------+
| "&"                                             | Bitwise AND                           |
+-------------------------------------------------+---------------------------------------+
| "<<", ">>"                                      | Shifts                                |
+-------------------------------------------------+---------------------------------------+
| "+", "-"                                        | Addition and subtraction              |
+-------------------------------------------------+---------------------------------------+
| "*", "@", "/", "//", "%"                        | Multiplication, matrix                |
|                                                 | multiplication, division, floor       |
|                                                 | division, remainder [5]               |
+-------------------------------------------------+---------------------------------------+
| "+x", "-x", "~x"                                | Positive, negative, bitwise NOT       |
+-------------------------------------------------+---------------------------------------+
| "**"                                            | Exponentiation [6]                    |
+-------------------------------------------------+---------------------------------------+
| "await" "x"                                     | Await expression                      |
+-------------------------------------------------+---------------------------------------+
| "x[index]", "x[index:index]",                   | Subscription, slicing, call,          |
| "x(arguments...)", "x.attribute"                | attribute reference                   |
+-------------------------------------------------+---------------------------------------+
| "(expressions...)",  "[expressions...]", "{key: | Binding or parenthesized expression,  |
| value...}", "{expressions...}"                  | list display, dictionary display, set |
|                                                 | display                               |
+-------------------------------------------------+---------------------------------------+
... ...

>>> p.basename('E:\\openlab--Training\\Python--刘建宏\\3.26\\遍历磁盘.py')     # 获取文件名
'遍历磁盘.py'
>>> p.dirname('E:\\openlab--Training\\Python--刘建宏\\3.26\\遍历磁盘.py')      # 获取路径
'E:\\openlab--Training\\Python--刘建宏\\3.26'
>>> p.curdir																 # 返回相对路径
'.'  
>>> p.exists('E:\\openlab--Training\\Python--刘建宏\\3.26\\遍历磁盘.py')       # 判断目录或者文件是否存在
True                
>>> p.getctime('E:\\openlab--Training\\Python--刘建宏\\3.26\\遍历磁盘.py')     # 获取文件的创建时间
1585210654.3121617
>>> p.getmtime('E:\\openlab--Training\\Python--刘建宏\\3.26\\遍历磁盘.py')		# 获取文件内容修改时间
1585210653.45535
>>> p.getatime('E:\\openlab--Training\\Python--刘建宏\\3.26\\遍历磁盘.py')     # 获取文件的元数据修改时间
1627211302.8820622
>>> p.getsize('E:\\openlab--Training\\Python--刘建宏\\3.26\\遍历磁盘.py')      # 获取文件或者文件夹字节大小
684
>>> p.isdir('E:\\openlab--Training\\Python--刘建宏\\3.26\\')                  # 判断是否为目录  
True
>>> p.isfile('E:\\openlab--Training\\Python--刘建宏\\3.26\\遍历磁盘.py')       # 判断是否为文件
True
>>> p.isabs('E:\\openlab--Training\\Python--刘建宏\\3.26\\')                  # 判断是否为绝对路径
True
islink																		 # 判断是否为链接文件
ismount																		 # 判断是否为挂载文件
>>> file_name = 'wan.txt'  											    	 # 拼接文件路径和文件名
>>> url = 'c:/user/system/info/'
>>> p.join(url, file_name)
'c:/user/system/info/wan.txt'
>>> p.sep																	 # 查看路径分隔符				
'\\'
>>> p.split('E:\\openlab--Training\\Python--刘建宏\\3.26\\遍历磁盘.py')        # 返回文件的路径和文件名(元组)
('E:\\openlab--Training\\Python--刘建宏\\3.26', '遍历磁盘.py')

练习

import os
from os import path


def scanner_file(url):
    files = os.listdir(url)
    for f in files:
        # real_path = url + "\\" + f
        # real_path = path.join(url, f)
        real_path = path.join(url, f)
        if path.isfile(real_path):
            print(path.abspath(real_path))
        elif path.isdir(real_path):
            scanner_file(real_path)
        else:
            print("其他情况")


scanner_file("D:\\软件安装包")

5、sys

作用:提供了许多函数和变量来处理 Python 运行时环境的不同部分

>>> import sys
>>> dir(sys)
['addaudithook', 'api_version', 'argv', 'audit', 'base_exec_prefix', 'base_prefix', 'breakpointhook', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dllhandle', 'dont_write_bytecode', 'exc_info', 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info', 'float_repr_style', 'get_asyncgen_hooks', 'get_coroutine_origin_tracking_depth', 'getallocatedblocks', 'getcheckinterval', 'getdefaultencoding', 'getfilesystemencodeerrors', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'getswitchinterval', 'gettrace', 'getwindowsversion', 'hash_info', 'hexversion', 'implementation', 'int_info', 'intern', 'is_finalizing', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'ps1', 'ps2', 'pycache_prefix', 'set_asyncgen_hooks', 'set_coroutine_origin_tracking_depth', 'setcheckinterval', 'setprofile', 'setrecursionlimit', 'setswitchinterval', 'settrace', 'stderr', 'stdin', 'stdout', 'thread_info', 'unraisablehook', 'version', 'version_info', 'warnoptions', 'winver']
>>> sys.api_version					# 查看Python内部版本号
1013
>>> sys.argv                        # 接受脚本参数,第一个参数是脚本名(类似于shell位置变量)
['']
>>> sys.copyright 					# 查看Python版权信息
'Copyright (c) 2001-2020 Python Software Foundation.\nAll Rights Reserved.\n\nCopyright (c) 2000 BeOpen.com.\nAll Rights Reserved.\n\nCopyright (c) 1995-2001 Corporation for National Research Initiatives.\nAll Rights Reserved.\n\nCopyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\nAll Rights Reserved.'
>>> sys.exit()						# 退出系统

C:\Windows\system32>
>>> sys.getdefaultencoding()		# 获取解释器编码
'utf-8'
>>> sys.getfilesystemencoding()		# 获取文件系统编码
'utf-8'
>>> sys.getrecursionlimit()			# 获取Python递归限制层数(默认1000层)
1000
>>> sys.setrecursionlimit(8000)		# 设置Python递归限制层数
>>> sys.getrecursionlimit()
8000
>>> s = [1, 2, 3, 4]				# 获取Python对象的引用计数
>>> sys.getrefcount(s)
2
>>> ss = s
>>> sys.getrefcount(s)
3
>>> sys.getwindowsversion()			# 获取窗口大小
sys.getwindowsversion(major=10, minor=0, build=18363, platform=2, service_pack='')
>>> sys.version						# 获取Python版本信息
'3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]'
>>> sys.version_info				# 获取Python版本信息
sys.version_info(major=3, minor=8, micro=2, releaselevel='final', serial=0)

Python的垃圾回收原理:引用计数为主,以标记清除和分带收集为辅

6、hashlib

作用:hash加密

算法分类:

按照算法是否可逆分类

  • 可逆算法

    • 对称加密算法

      加密与解密使用同一把秘钥

      DES

      SEDS

      AES

      IDEA

    • 非对称加密算法

      加密与解密使用不同的秘钥(公钥/私钥)

      RSA

      DH

      DSA

      EC

  • 非可逆算法

    特地:不可逆行、唯一性、雪崩效应

    • hash

      MD5

      SHA

      HMAC

>>> import hashlib
>>> dir(hashlib)
['__all__', '__block_openssl_constructor', '__builtin_constructor_cache', '__builtins__', '__cached__', '__doc__', '__file__', '__get_builtin_constructor', '__loader__', '__name__', '__package__', '__spec__', '_hashlib', 'algorithms_available', 'algorithms_guaranteed', 'blake2b', 'blake2s', 'md5', 'new', 'pbkdf2_hmac', 'scrypt', 'sha1', 'sha224', 'sha256', 'sha384', 'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512', 'sha512', 'shake_128', 'shake_256']
# hash 加密使用方法:
>>> md5 = hashlib.md5("hello python".encode("utf-8"))
>>> md5
<md5 HASH object @ 0x00000154A70C7C10>
>>> md5.hexdigest()
'e53024684c9be1dd3f6114ecc8bbdddc'
# 使用update颜值混淆加密
>>> md5 = hashlib.md5("hello python".encode("utf-8"))
>>> md5.hexdigest()
'e53024684c9be1dd3f6114ecc8bbdddc'
>>> md5.update("xnudsy832d0ws2h*&^$%$%VY&".encode("utf-8"))
>>> md5.hexdigest()
'f2da0a61a7e483d9b1df742958eb0244'

应用:

  • 数据校验,安全检查 ---- 不需要做盐值混淆
  • 数据库传输 ---- 需要做盐值混淆

注意:hashlib中所有hash算法操作方法雷同

用途:数字摘要,密码信息加密

7、hmac

作用:对称加密 + hash加密

>>> import hmac
>>> dir(hmac)
['HMAC', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_hashlib', '_hashopenssl', '_openssl_md_meths', '_warnings', 'compare_digest', 'digest', 'digest_size', 'new', 'trans_36', 'trans_5C']
# 先进行对称加密,在进行MD5加密
>>> hmac = hmac.new("123456".encode("utf-8"), "zhangwanqiang".encode("utf-8"), "MD5")
>>> hmac.hexdigest()
'eb4ee22adc6a3f77696703f21d65ac07'

用途:密码信息加密(安全性较高)

8、time

作用:时间相关

>>> import time
>>> dir(time)
['_STRUCT_TM_ITEMS', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'altzone', 'asctime', 'ctime', 'daylight', 'get_clock_info', 'gmtime', 'localtime', 'mktime', 'monotonic', 'monotonic_ns', 'perf_counter', 'perf_counter_ns', 'process_time', 'process_time_ns', 'sleep', 'strftime', 'strptime', 'struct_time', 'thread_time', 'thread_time_ns', 'time', 'time_ns', 'timezone', 'tzname']
>>> time.asctime()							 # 获取当前时间
'Tue Jul 27 16:54:56 2021'
>>> time.ctime()							 # 获取当前时间
'Tue Jul 27 17:16:23 2021'
>>> time.localtime()						 # 获取本地时间
time.struct_time(tm_year=2021, tm_mon=7, tm_mday=27, tm_hour=16, tm_min=55, tm_sec=18, tm_wday=1, tm_yday=208, tm_isdst=0)
>>> ltime = time.localtime()
>>> ltime.tm_year
2021
>>> ltime.tm_mon
7
>>> ltime.tm_mday
27
>>> print("%s-%s-%s %s:%s:%s" %(ltime.tm_year, ltime.tm_mon, ltime.tm_mday, ltime.tm_hour, ltime.tm_min, ltime.tm_sec))								  # 获取本地时间(方便格式化时间显示) 
2021-7-27 16:58:17
>>> time.sleep(10)							 # 程序休眠10s
>>> time.time()								 # 获取时间戳(1970-7-1 0:0:0 到当前时间的秒数)
1627377088.9805143
>>> time.strftime("%Y-%m-%d %H:%M:%S")		 # 时间对象格式化显示,转换成字符串
'2021-07-27 17:19:30'
>>> ss = "2008-08-08 08:08:08"				 # 将字符串转换为时间对象
>>> time.strptime(ss, "%Y-%m-%d %H:%M:%S")
time.struct_time(tm_year=2008, tm_mon=8, tm_mday=8, tm_hour=8, tm_min=8, tm_sec=8, tm_wday=4, tm_yday=221, tm_isdst=-1)

9、datetime

作用:时间相关(是对time模块的补充)

>>> import datetime
>>> dir(datetime)
['MAXYEAR', 'MINYEAR', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'date', 'datetime', 'datetime_CAPI', 'sys', 'time', 'timedelta', 'timezone', 'tzinfo']
>>> from datetime import datetime
>>> dir(datetime)
['__add__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__radd__', '__reduce__', '__reduce_ex__', '__repr__', '__rsub__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', 'astimezone', 'combine', 'ctime', 'date', 'day', 'dst', 'fold', 'fromisocalendar', 'fromisoformat', 'fromordinal', 'fromtimestamp', 'hour', 'isocalendar', 'isoformat', 'isoweekday', 'max', 'microsecond', 'min', 'minute', 'month', 'now', 'replace', 'resolution', 'second', 'strftime', 'strptime', 'time', 'timestamp', 'timetuple', 'timetz', 'today', 'toordinal', 'tzinfo', 'tzname', 'utcfromtimestamp', 'utcnow', 'utcoffset', 'utctimetuple', 'weekday', 'year']
>>> datetime.now()							 # 获取当前时间 
datetime.datetime(2021, 7, 27, 17, 32, 28, 13861)

10、calendar

作用:日历相关模块

>>> import calendar
>>> dir(calendar)
['Calendar', 'EPOCH', 'FRIDAY', 'February', 'HTMLCalendar', 'IllegalMonthError', 'IllegalWeekdayError', 'January', 'LocaleHTMLCalendar', 'LocaleTextCalendar', 'MONDAY', 'SATURDAY', 'SUNDAY', 'THURSDAY', 'TUESDAY', 'TextCalendar', 'WEDNESDAY', '_EPOCH_ORD', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_colwidth', '_locale', '_localized_day', '_localized_month', '_monthlen', '_nextmonth', '_prevmonth', '_spacing', 'c', 'calendar', 'datetime', 'day_abbr', 'day_name', 'different_locale', 'error', 'firstweekday', 'format', 'formatstring', 'isleap', 'leapdays', 'main', 'mdays', 'month', 'month_abbr', 'month_name', 'monthcalendar', 'monthrange', 'prcal', 'prmonth', 'prweek', 'repeat', 'setfirstweekday', 'sys', 'timegm', 'week', 'weekday', 'weekheader']

11、UUID

作用:获取用不重复的字符串

>>> import uuid
>>> dir(uuid)
['Enum', 'NAMESPACE_DNS', 'NAMESPACE_OID', 'NAMESPACE_URL', 'NAMESPACE_X500', 'RESERVED_FUTURE', 'RESERVED_MICROSOFT', 'RESERVED_NCS', 'RFC_4122', 'SafeUUID', 'UUID', '_AIX', '_DARWIN', '_GETTERS', '_LINUX', '_OS_GETTERS', '_UuidCreate', '_WINDOWS', '__author__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_arp_getnode', '_find_mac', '_generate_time_safe', '_has_uuid_generate_time_safe', '_ifconfig_getnode', '_ip_getnode', '_ipconfig_getnode', '_is_universal', '_lanscan_getnode', '_last_timestamp', '_load_system_functions', '_netbios_getnode', '_netstat_getnode', '_node', '_popen', '_random_getnode', '_unix_getnode', '_uuid', '_windll_getnode', 'bytes_', 'getnode', 'int_', 'os', 'platform', 'sys', 'uuid1', 'uuid3', 'uuid4', 'uuid5']
>>> uuid.uuid4()							# 获取用不重复的字符串,每次获取都不相同
UUID('c6e232f2-f55c-4918-b0ac-397cd5f5d518')
>>> uuid.uuid4().hex
'abe6f101edc448c4b9de6828e709c8e2'
>>> uuid.uuid4().hex
'e41a9b3e006c45ee9c5c43f3e1e64ba8'
>>> uuid.uuid4().hex
'4a22a06747a042c6ac536500e907c9a4'
>>> uuid.uuid4().hex
'7300954d813b40dcace0606d02c531b9
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值