python - 如何使用 python 脚本将新目录创建到 SD 卡
问题描述
我需要在 SD 卡中设置树莓派。这就是为什么在将 raspberrypi 写入 SD 卡后,我需要在 /Volumes/boot 创建一个名为 ssh 的目录。为此我尝试了
os.mkdir("/Volumes/boot/ssh")
但它显示/Volumes/boot: No such file or directory
但是,如果我在 python3 的控制台中编写相同的命令,而不是 python 脚本,它会完美运行。我也试过:
os.mkdir("/Volumes/boot/ssh")
但它也不起作用。那么,如何使用 python 脚本在我的 SD 卡中创建 /Volumes/boot/ssh 这个文件夹?
解决方案
推荐阅读
- python - Mongoengine 聚合不像 mongo 那样工作
- javascript - 不使用 Object.entries() 返回键值对数组的数组
- android - android中的依赖问题
- teradata - 失败 2616 计算过程中发生数值溢出
- java - 无法将存储在 Firebase 数据库中的图像(静态)提取到我的应用程序中
- php - PHP / MySQL:图像成功保存到数据库但无法在网页上显示
- sqlite - 我可以像android中的sqlite密码一样将密码粘贴到Room数据库中吗?
- unity3d - 活跃的布娃娃角色仍然站在地上
- css - 在垫子树中将孩子与线连接到父母
- powershell - 如何查询有收件人的约会项目?