当前位置:网站首页>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边栏推荐
- Global and Chinese ammonium dimolybdate market in-depth analysis and prospect risk prediction report 2022 Edition
- random shuffle注意
- Unity3d human skin real time rendering real simulated human skin real time rendering "suggestions collection"
- Can netstat still play like this?
- Check log4j problems using stain analysis
- 怎么将yolov5中的PANet层改为BiFPN
- [fluent] future asynchronous programming (introduction | then method | exception capture | async, await keywords | whencomplete method | timeout method)
- Serious security vulnerabilities reported by moxa mxview network management software
- Matlab tips (24) RBF, GRNN, PNN neural network
- 为什么会选择框架?选择什么样的框架
猜你喜欢
where 1=1 是什么意思
【Flutter】shared_ Preferences local storage (introduction | install the shared_preferences plug-in | use the shared_preferences process)
TCP 三次握手和四次挥手机制,TCP为什么要三次握手和四次挥手,TCP 连接建立失败处理机制
Joking about Domain Driven Design (III) -- Dilemma
C语言初阶-指针详解-庖丁解牛篇
Can netstat still play like this?
I2C 子系统(四):I2C debug
From C to capable -- use the pointer as a function parameter to find out whether the string is a palindrome character
Random shuffle note
Principle and application of database
随机推荐
Basic operation of binary tree (C language version)
HTB-Devel
Super easy to use logzero
random shuffle注意
Gbase 8C system table PG_ am
SqlServer行转列PIVOT
[C语言]给账号密码进行MD5加密
内存泄漏工具VLD安装及使用
I2C 子系统(四):I2C debug
Use cve-2021-43893 to delete files on the domain controller
Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!
Gbase 8C trigger (II)
tensor中的append应该如何实现
I2C subsystem (III): I2C driver
Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception
[shutter] banner carousel component (shutter_wiper plug-in | swiper component)
[translation] flux is safe. Gain more confidence through fuzzy processing
怎么将yolov5中的PANet层改为BiFPN
Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 2)
Apple releases MacOS 11.6.4 update: mainly security fixes