当前位置:网站首页>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边栏推荐
- 【Flutter】shared_ Preferences local storage (introduction | install the shared_preferences plug-in | use the shared_preferences process)
- Gbase 8C system table PG_ attribute
- I2C subsystem (II): I3C spec
- 迅雷chrome扩展插件造成服务器返回的数据js解析页面数据异常
- SQL server queries the table structure of the specified table
- [translation] flux is safe. Gain more confidence through fuzzy processing
- HTB-Devel
- Wechat - developed by wechat official account Net core access
- Source code analysis | layout file loading process
- 一文带你了解 ZigBee
猜你喜欢
定了,就选它
Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes
How to change the panet layer in yolov5 to bifpn
The Linux server needs to install the agent software EPS (agent) database
Random Shuffle attention
HTB-Devel
Sqlserver row to column pivot
What is the way out for children from poor families?
左连接,内连接
Basic operation of binary tree (C language version)
随机推荐
Add MDF database file to SQL Server database, and the error is reported
js根据树结构查找某个节点的下面的所有父节点或者子节点
[shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)
I2C subsystem (IV): I2C debug
C language beginner level - pointer explanation - paoding jieniu chapter
用docker 連接mysql的過程
Linear rectification function relu and its variants in deep learning activation function
Principle and application of database
Practice of traffic recording and playback in vivo
Check log4j problems using stain analysis
C语言初阶-指针详解-庖丁解牛篇
Add automatic model generation function to hade
超好用的日志库 logzero
Interview stereotyped version
Cron表达式介绍
[translation] the background project has joined the CNCF incubator
I2C 子系统(四):I2C debug
Practice of traffic recording and playback in vivo
Serious security vulnerabilities reported by moxa mxview network management software
Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes