python | Solve the problem that the file cannot be found

import os
dirpath = os.path.dirname(os.path.abspath(__file__))

Add dirpath before the file

Guess you like

Origin blog.csdn.net/weixin_43236007/article/details/112187365