当前位置:网站首页>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边栏推荐
- I2C 子系统(二):I3C spec
- MATLAB小技巧(24)RBF,GRNN,PNN-神经网络
- HW initial preparation
- Tensorflow to pytorch notes; tf. gather_ Nd (x, y) to pytorch
- Serious security vulnerabilities reported by moxa mxview network management software
- where 1=1 是什么意思
- Strategy application of Dameng database
- Source code analysis | resource loading resources
- "Analysis of 43 cases of MATLAB neural network": Chapter 43 efficient programming skills of neural network -- Discussion Based on the characteristics of the new version of MATLAB r2012b
- 内存泄漏工具VLD安装及使用
猜你喜欢
内存泄漏工具VLD安装及使用
Random Shuffle attention
[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
Mathematical statistics -- Sampling and sampling distribution
[fluent] listview list (map method description of list set | vertical list | horizontal list | code example)
I2C subsystem (IV): I2C debug
I2C 子系统(三):I2C Driver
一文带你了解 ZigBee
I2C 子系统(二):I3C spec
The process of connecting MySQL with docker
随机推荐
Interview stereotyped version
I2C 子系统(三):I2C Driver
搭建私有云盘 cloudreve
左连接,内连接
Gbase 8C function / stored procedure definition
[translation] the background project has joined the CNCF incubator
Use cve-2021-43893 to delete files on the domain controller
I2C subsystem (II): I3C spec
用docker 连接mysql的过程
[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
[leectode 2022.2.15] lucky numbers in the matrix
[fluent] JSON model conversion (JSON serialization tool | JSON manual serialization | writing dart model classes according to JSON | online automatic conversion of dart classes according to JSON)
为什么会选择框架?选择什么样的框架
【Flutter】shared_ Preferences local storage (introduction | install the shared_preferences plug-in | use the shared_preferences process)
yii2 中andWhere多个or查询 orm条件
Gbase 8C trigger (II)
Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid
C语言中左值和右值的区别
[principles of multithreading and high concurrency: 1_cpu multi-level cache model]
Getting started | jetpack hilt dependency injection framework