답변을 검색했지만 지금까지 도움이되지 않았습니다. odt 파일을 만들고 텍스트로 채우기 위해 사용하려는 방법이 있습니다. 또한 파일을 만들 때 사용자가 보길 원합니다. - 생성 및 오류없이 sample.odt 저장된python3 unotools 연결 오류가 연결하지 못했습니다.
unotools.errors.ConnectionError: failed to connect: ('socket,host=localhost,port=8100', {})
unotools 샘플 터미널에서 잘 작동 : 나는 파이썬에게 3.4.3 unotools 0.3.3 리눅스 민트 17.1 LibreOffice와 4.2.8.2
문제를 사용하고 있습니다. 내 초안 코드 :
def writer_report(self):
subprocess.Popen(["soffice", "--accept='socket,host=localhost,port=8100;urp;StarOffice.Service'"])
time.sleep(5) # using this to give time for LibreOffice to open - temporary
context = connect(Socket('localhost', '8100'))
writer = Writer(context)
writer.set_string_to_end('world\n')
writer.set_string_to_start('hello\n')
writer.store_to_url('output.odt','FilterName','writer8')
writer.close(True)
LibreOffice 응용 프로그램이 열리고 열린 상태로 유지됩니다. 그러나 연결이 끊긴 것 같습니다.
누군가가 나를 도와 줄 수 있기를 바랍니다. 감사합니다.
감사합니다. 나는 시간을 연장하려고했지만 여전히 기쁨은 없습니다. –