import os
import sys
open(os.path.join(os.path.dirname(sys.argv[0]), 'yourfile.txt')
“No such file or directory” when files are in the same directory
最新推荐文章于 2021-11-24 21:35:32 发布
import os
import sys
open(os.path.join(os.path.dirname(sys.argv[0]), 'yourfile.txt')