已有183人关注
wordtopdf函数路劲分割错误
发表在Python图书答疑 2020-04-16 《Python项目开发案例集锦》第8章 Word助手 129页-129页
是否精华
版块置顶:
for fullfilename in filelist:
    temp = fullfilename.split('\\')
    path = temp[0]
    softfilename = os.path.splitext(temp[1])
    filename = temp[1]
    os.chdir(path)
    doc = os.path.abspath(filename)

temp=fullfiename.split('\\')分隔出来的结果为:

['C:', 'Users', 'eric_', 'Downloads', '20171222184343_ix8n2m1uct.docx']

根据后面使用的情况,应当使用

temp = os.path.split(fullfilename)


2020-04-16 13:15:50编辑
分享到:
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照