当前位置:网站首页>open file in 'w' mode: IOError: [Errno 2] No such file or directory
open file in 'w' mode: IOError: [Errno 2] No such file or directory
2022-07-03 02:51:00 【Zafo】
problem :
When I try to open a file in write mode with the following code: When I try to use the following code to write in When opening a file in mode :
packetFile = open("%s/%s/%s/%s.mol2" % ("dir", "dir2", "dir3", "some_file"), "w")Gives me the following error: Gave me the following error :
IOError: [Errno 2] No such file or directory: 'dir/dir2/dir3/some_file.mol2'The w mode should create the file if it doesn't exist, right? If the file doesn't exist , w The schema should create a file , Am I right? ?So how can this error ever occur? So how did this error happen ?
Solution :
Reference resources : https://stackoom.com/en/question/A4lw边栏推荐
- Check log4j problems using stain analysis
- Le processus de connexion mysql avec docker
- SQL statement
- [shutter] banner carousel component (shutter_wiper plug-in | swiper component)
- I2C subsystem (III): I2C driver
- [C语言]给账号密码进行MD5加密
- Informatics Olympiad one general question bank 1006 a+b questions
- 搭建私有云盘 cloudreve
- Random shuffle note
- Global and Chinese ammonium dimolybdate market in-depth analysis and prospect risk prediction report 2022 Edition
猜你喜欢

Sous - système I2C (IV): débogage I2C
![[translation] modern application load balancing with centralized control plane](/img/b0/22e9bf098d580b2af67255ddcdc0d5.jpg)
[translation] modern application load balancing with centralized control plane

《MATLAB 神经网络43个案例分析》:第43章 神经网络高效编程技巧——基于MATLAB R2012b新版本特性的探讨

Xiaodi notes

From C to capable -- use the pointer as a function parameter to find out whether the string is a palindrome character

基于can总线的A2L文件解析(2)

左连接,内连接

Pytest (6) -fixture (Firmware)

内存泄漏工具VLD安装及使用

Pytest (6) -fixture (Firmware)
随机推荐
[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
Xiaodi notes
Gbase 8C function / stored procedure definition
I2C 子系統(四):I2C debug
The solution of "the required function is not supported" in win10 remote desktop connection is to modify the Registry [easy to understand]
Kubernetes cluster log and efk architecture log scheme
Gbase 8C trigger (II)
Three.js本地环境搭建
Concrete CMS vulnerability
How to return ordered keys after counter counts the quantity
Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!
Random Shuffle attention
一文带你了解 ZigBee
I2C subsystem (IV): I2C debug
HTB-Devel
错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
[fluent] listview list (map method description of list set | vertical list | horizontal list | code example)
HW-初始准备
[leectode 2022.2.15] lucky numbers in the matrix
C语言初阶-指针详解-庖丁解牛篇