09 2021 档案
摘要:打开文件 #方法一:使用系统内置函数open def open_file(): try: file = open(r"test.txt", "r") print("文件名称:",file.name) print("文件是否已关闭:",file.closed) print("文件访问模式:", fil
阅读全文
摘要:1.获取本机CPU # 早期的CPU是单核:实现多个程序并行,在某一时间点,其实只有一个进程 # 后来硬件多核CPU:多个进程是并行执行。 from multiprocessing import cpu_count print("CPU内核数量:", cpu_count()) """ 生命周期为:
阅读全文