단어 문서를 열고 그 안에 사진을 삽입하는 코드가 있습니다. GUI 부분은 매우 까다 롭습니다. 나는 당신이 문서를 끌어서 놓기 만하면된다. 그리고 나서 나는 코드를 실행하고 드래그 앤 드롭 기능에서 가져온 파일 이름을 사용할 것이다 ...wx txtctrl에서 파일 이름을 여는 방법
나는 코드를 사용했다. 특히
Wxpython browse for or drag and drop folder
이 부분 :이 스레드에서
class MyFrame(wx.Frame):
def __init__(self, parent,id):
wx.Frame.__init__(self,parent,id,'report maker', size=(300,200))
dt1 = MyFileDropTarget(self)
self.tc_files = wx.TextCtrl(self, wx.ID_ANY)
self.tc_files.SetDropTarget(dt1)
def notify(self, files):
"""Update file in testcontrol after drag and drop"""
self.tc_files.SetValue(files[0])
기본적으로 나는 드래그 (Win32에서 사용) 워드 문서를 떨어 프로그램에서 다른 장소에서 그것을 열고 자했습니다 . 끌어서 놓은 파일을 여는 방법을 모르겠습니다. 나는이 라인을 따라 일종의 많은 것을 시도했다 ...
doc = word.Documents.Open(notify(tc_files, files[0])
미리 감사드립니다!