首页 > 其他 > 详细

地址目录的操作

时间:2017-02-17 12:47:46      阅读:163      评论:0      收藏:0      [点我收藏+]

def draw_radar(radarfile,outdir = ""):
    outdir = outdir
    print ‘outdir=‘,outdir,type(‘outdir‘)
    s=outdir.split(‘\\‘)
    print s[0],s[1],s[2]
    a=s[0]
    b=s[1]
    c=s[2]
    print ‘a=‘,a,‘b=‘,b,‘c=‘,c
    d=os.path.join(‘E:\\‘,‘radarexe‘,‘output‘,‘PN3‘,a,b)
    print ‘d=‘,d
    if not os.path.exists(d):  #判断目录是否存在
        os.makedirs(d)  #检查目录是否存在 不存在 则新建

地址目录的操作

原文:http://www.cnblogs.com/xiaoxiaoshuaishuai0219/p/6409298.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!