12 2024 档案
摘要:# math 数学计算 import math # # 计算阶乘 # print(math.factorial(6)) # 向下取整 12 # print(math.floor(12.98)) # 向上取整 15 # print(math.floor(15.01)) # 幂运算 8.0 2*2*2
阅读全文
摘要:# sys 系统相关的功能 import sys from pprint import pprint print("hello world") # 程序退出 # sys.exit() # 查找模块的路径 # pprint(sys.path) # 可以像 input() 一样,从标准输入中读取数据 #
阅读全文
摘要:import time t = time.time() # 时间戳 1970年 1735540726.765775 print(t) t = time.localtime() # 结构化的时间 time.struct_time(tm_year=2024, tm_mon=12, tm_mday=30,
阅读全文
摘要:import os # 获取系统名字 nt # print(os.name) # # 路径分隔符 windows \ 非 windows / # print(os.sep) # abspath 获取文件的 绝对路径 # print(os.path.abspath('./')) # # 是否为文件夹
阅读全文