当前位置:网站首页>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边栏推荐
- Two dimensional format array format index subscript continuity problem leads to return JSON format problem
- Today, it's time to copy the bottom!
- 迅雷chrome扩展插件造成服务器返回的数据js解析页面数据异常
- The difference between left value and right value in C language
- I2C 子系统(三):I2C Driver
- Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception
- [translation] flux is safe. Gain more confidence through fuzzy processing
- [fluent] listview list (map method description of list set | vertical list | horizontal list | code example)
- Kubernetes family container housekeeper pod online Q & A?
- Unity3d human skin real time rendering real simulated human skin real time rendering "suggestions collection"
猜你喜欢

sql server数据库添加 mdf数据库文件,遇到的报错
![[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)](/img/04/88ce45d370a2e6052c2fce558aa531.jpg)
[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)

Matlab tips (24) RBF, GRNN, PNN neural network

Basic operation of binary tree (C language version)

TCP 三次握手和四次挥手机制,TCP为什么要三次握手和四次挥手,TCP 连接建立失败处理机制

The Linux server needs to install the agent software EPS (agent) database

Installation and use of memory leak tool VLD

The process of connecting MySQL with docker

random shuffle注意

Linear rectification function relu and its variants in deep learning activation function
随机推荐
I2C subsystem (IV): I2C debug
Practice of traffic recording and playback in vivo
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
左值右指解释的比较好的
Yiwen takes you to know ZigBee
Gbase 8C create user / role example 2
Xiaodi notes
[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
vfork执行时出现Segmentation fault
I2C 子系统(一):I2C spec
Installation and use of memory leak tool VLD
The Linux server needs to install the agent software EPS (agent) database
How to return ordered keys after counter counts the quantity
Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid
MATLAB小技巧(24)RBF,GRNN,PNN-神经网络
二维格式数组格式索引下标连续问题导致 返回json 格式问题
Gbase 8C system table PG_ amop
一文带你了解 ZigBee
HW initial preparation
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc