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 阅读全文
posted @ 2024-12-31 17:21 13522679763-任国强 阅读(6) 评论(0) 推荐(0)
摘要:# sys 系统相关的功能 import sys from pprint import pprint print("hello world") # 程序退出 # sys.exit() # 查找模块的路径 # pprint(sys.path) # 可以像 input() 一样,从标准输入中读取数据 # 阅读全文
posted @ 2024-12-31 16:30 13522679763-任国强 阅读(4) 评论(0) 推荐(0)
摘要: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, 阅读全文
posted @ 2024-12-31 16:07 13522679763-任国强 阅读(3) 评论(0) 推荐(0)
摘要:import os # 获取系统名字 nt # print(os.name) # # 路径分隔符 windows \ 非 windows / # print(os.sep) # abspath 获取文件的 绝对路径 # print(os.path.abspath('./')) # # 是否为文件夹 阅读全文
posted @ 2024-12-31 16:04 13522679763-任国强 阅读(6) 评论(0) 推荐(0)

点击右上角即可分享
微信分享提示