ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

create dir or file in Qpython

create dir or file in Qpython

Create dir or file in Qpython

Import qpy
Import os

'''
Create d or f in cash
'''
os.mkdir(qpy.tmp+'dir1')
open(qpy.tmp+'/dir1/file1.py','w')

'''
create d or f on the container directory,and will create file1 on second run
'''
if not os.path.exists('../dir1'):
os.mkdir('../dir1')
else:
open('../dir1/file1.py','w')

返回列表