当前位置:天才代写 > Python代写,python代做代考-价格便宜,0时差服务 > python 判断文件是否存在-python基础

python 判断文件是否存在-python基础

2021-02-20 16:32 星期六 所属: Python代写,python代做代考-价格便宜,0时差服务 浏览:537

python 分辨文档是不是存有

应用os.path.exists涵数

from os.path import exists
if exists('c.txt'):
    with open('c.txt','a') as f:
        f.write('www.h3blog.com') 
        f.close()
else:
    with open('c.txt','a') as f:
        f.write('www.h3blog.com')
        f.close()
 

    关键字:

天才代写-代写联系方式