使用给定上下文创建实例
create instance with given context
我无法按照此处所述使用给定上下文创建实例...
https://thejeshgn.com/2019/05/27/python-in-libreoffice-macros/
我使用了这个代码:
>>> import uno
>>> context = uno.getComponentContext()
>>> desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context)
并得到这个错误:
INTERACT
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Roaming\LibreOffice\user\uno_packages\cache\uno_packages\lu552037uadn.tmp_\apso-v2.oxt\python\pythonpath\apso_utils.py", line 649, in interact
line = self.raw_input(prompt)
File "C:\Program Files\LibreOffice\program\python-core-3.8.8\lib\code.py", line 274, in raw_input
return input(prompt)
EOFError: EOF when reading a line
我通过扩展程序使用了 APSO 控制台....
https://extensions.libreoffice.org/en/extensions/show/apso-alternative-script-organizer-for-python
重新启动 OS (windows)
后问题已解决
我无法按照此处所述使用给定上下文创建实例...
https://thejeshgn.com/2019/05/27/python-in-libreoffice-macros/
我使用了这个代码:
>>> import uno
>>> context = uno.getComponentContext()
>>> desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context)
并得到这个错误:
INTERACT
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Roaming\LibreOffice\user\uno_packages\cache\uno_packages\lu552037uadn.tmp_\apso-v2.oxt\python\pythonpath\apso_utils.py", line 649, in interact
line = self.raw_input(prompt)
File "C:\Program Files\LibreOffice\program\python-core-3.8.8\lib\code.py", line 274, in raw_input
return input(prompt)
EOFError: EOF when reading a line
我通过扩展程序使用了 APSO 控制台....
https://extensions.libreoffice.org/en/extensions/show/apso-alternative-script-organizer-for-python
重新启动 OS (windows)
后问题已解决