如何解决为什么不将转换后的文件放到桌面上?
因此,我正在做的一部分工作是希望我选择一个.docx文件,将其转换为pdf并将其存储在某处。我想我将其存储在桌面上,但看不到(运行代码时没有错误)。怎么了?
def thing():
window.filename = filedialog.askopenfilename(initialdir="/",title="Select file",filetypes=(("word documents","*.docx"),("all files","*.*")))
print(window.filename)
in_file = window.filename
out_file = os.path.join(os.path.join(os.environ['USERPROFILE']),'Desktop')
word = comtypes.client.CreateObject('Word.Application')
doc = word.Documents.Open(in_file)
doc.SaveAs(out_file,FileFormat=17)
doc.Close()
word.Quit()
b = Button(window,text="Test",command=select_file)
b.pack()
window.mainloop()
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com(将#修改为@)