import os dirlist = os.listdir() #打开文件 fo = open("dirs.txt","w") #遍历 for dir in dirlist: #判断如果是文件夹 if os.path.isdir(dir): #写 file.write(str(os.path.ab ...
分类:
编程语言 时间:
2021-07-16 17:33:40
阅读次数:
0
1. os的system原理 system函数可以将字符串转化成命令在服务器上运行;其原理是每一条system函数执行时,其会创建一个子进程在系统上执行命令行,子进程的执行结果无法影响主进程; 上述原理会导致当需要执行多条命令行的时候可能得不到预期的结果; import os os.system(' ...
分类:
编程语言 时间:
2021-07-14 18:45:49
阅读次数:
0
文章目录 8.1 可变参数默认值设为`None`8.2 对子类继承的变量要做显式定义和赋初值8.3 严禁使用注释行等形式仅使功能失效8.4 慎用`copy`和 `deepcopy`8.5 系统路径推荐使用 `pathlib.Path`8.6 使用`subprocess`模块代替`os.system` ...
分类:
编程语言 时间:
2021-07-12 17:57:57
阅读次数:
0
defer是延迟执行。如果存在多个defer,运行顺序是先进后出,属于堆栈结构 f, err := os.Create(fileName) if err != nil { fmt.Println("Create file failed:", err) return nil, err } defer ...
分类:
编程语言 时间:
2021-07-05 19:08:05
阅读次数:
0
QFile 0、说明 QFile是读写文件的类,这里的文件包括文本文件、二进制文件、资源文件。 通常情况下,文件读写使用QFile、QTextStream、QDataStream就够了。 file name在构造QFile时传入,或者通过setFileName()自己设置。不管什么OS,QFile中 ...
分类:
其他好文 时间:
2021-07-05 18:20:36
阅读次数:
0
1、官网下载UnixODBC:unixODBC 2.3.2 麒麟官网:http://download.cs2c.com.cn/neokylin/desktop/development/5.4/ls_64/os/Packages/ 龙芯官网http://ftp.loongnix.org/os/loon ...
分类:
数据库 时间:
2021-07-05 18:16:03
阅读次数:
0
import os def traverse_dir(path): for root, dirs, files in os.walk(path): for dir in dirs: dir_path = os.path.join(root, dir) print(dir_path) traverse ...
分类:
其他好文 时间:
2021-07-05 17:23:58
阅读次数:
0
1、去树莓派官网下载镜像 https://www.raspberrypi.org/software/operating-systems/#raspberry-pi-os-32-bit 2、去github上下载 https://github.com/dhruvvyas90/qemu-rpi-kerne ...
If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0 with simple c ...
分类:
其他好文 时间:
2021-07-02 15:54:07
阅读次数:
0
linux线程私有数据 TSD 进程内的所有线程共享进程的数据空间,所以全局变量为所有线程共有。在某些场景下,线程需要保存自己的私有数据,这时可以创建线程私有数据(Thread-specific Data)TSD来解决。在线程内部,私有数据可以被线程的各个接口访问,但对其他线程屏蔽。 线程私有数据采 ...
分类:
编程语言 时间:
2021-07-02 15:35:15
阅读次数:
0