ich habe ein Problem, an dem ich jetzt schon lange hänge und leider bisher auch keine Foreneinträge finden konnte, die mir helfen. Ich habe ein Skript geschrieben, dass Wordconv.exe aufrufen soll. Wenn ich das manuell ohne Python mache sieht das so aus und funktioniert ohne Probleme:
"C:\Program Files (x86)\Microsoft Office\Office16\Wordconv.exe" -oice -nme "C:\doc2docx\doc\Beispiel.doc" "C:\doc2docx\docx\Beispiel.docx"
Die .exe wandelt eine .doc-Datei in eine .docx-Datei um.
In meinem .py-Skript steht:
Code: Alles auswählen
subprocess.call([Wordconv_path, "-oice", "-nme", src_path, dst_path])
Wenn ich das Skript ausführe taucht dann ein Fehler auf:
Ich habe bereits versucht das Skript als Administrator auszuführen - leider mit dem selben Ergebnis.PermissionError: [WinError 5] Zugriff verweigert
Ich bedanke mich schon mal an alle, die sich die Mühe machen und über mein Problem grübeln oder einen Lösungsvorschlag anbieten.
Falls Ihr noch weitere Informationen benötigt, sagt mir bitte Bescheid.
Gruß Stefan
ps. die gesamte Meldung:
Traceback (most recent call last):
File "<ipython-input-3-f49469283129>", line 1, in <module>
runfile('C:/Christian doc2docx/doc2docx/doc2docx.py', wdir='C:/Christian doc2docx/doc2docx')
File "C:\Users\sschoenhaerl\AppData\Roaming\Python\Python37\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "C:\Users\sschoenhaerl\AppData\Roaming\Python\Python37\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Christian doc2docx/doc2docx/doc2docx.py", line 20, in <module>
call_Wordconv(paths[0], paths[1], paths[2])
File "C:/Christian doc2docx/doc2docx/doc2docx.py", line 14, in call_Wordconv
subprocess.call([Wordconv_path, "-oice", "-nme", src_path, dst_path])
File "c:\users\sschoenhaerl\appdata\local\programs\python\python37-32\lib\subprocess.py", line 323, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\sschoenhaerl\AppData\Roaming\Python\Python37\site-packages\spyder_kernels\customize\spydercustomize.py", line 143, in __init__
super(SubprocessPopen, self).__init__(*args, **kwargs)
File "c:\users\sschoenhaerl\appdata\local\programs\python\python37-32\lib\subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "c:\users\sschoenhaerl\appdata\local\programs\python\python37-32\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
PermissionError: [WinError 5] Zugriff verweigert