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')

posted @ 2025-10-10 14:23  东君骑单车  阅读(2)  评论(0)    收藏  举报