如何在LibreOffice中运行python宏? [英] How to run python macros in LibreOffice?

查看:848
本文介绍了如何在LibreOffice中运行python宏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我转到工具->宏->组织宏-> Python 时,出现以下对话框:

When I go to Tools -> Macros -> Organize Macros -> Python I get this dialog:

不可能创建新的Python宏.

It is not possible to create new Python macros.

显然,LibreOffice没有没有Python编辑器,因此我不得不在其他地方编写宏,然后执行它们.

Apparently LibreOffice has no Python editor so I have to write the macros elsewhere and then just execute them.

但是我不知道在何处放置 Python脚本.

But I do not know where to put the Python scripts.

我尝试在系统范围内搜索名称中带有"HeloWorld" 的文件,但没有结果.

I tried a system-wide search for files with "HeloWorld" in their name and I got no results.

我试图将 test.py 文件放入:

/home/martin/.config/libreoffice/4/user/Scripts

并重新加载应用程序,但未显示 test 宏.

and reload the application, but the test macro is not shown.

我试图在工具->选项->路径中找到适当的设置,但是没有宏的路径" :

I tried to find the appropriate setting in Tools -> Options -> Path but there is no "path to macros":

如何从LibreOffice运行Python宏?

How can I run Python macros from LibreOffice?

这个问题是我学习Python和学习LibreOffice宏的一部分,因此,欢迎访问常规教程的任何链接. LibreOffice Python宏上的教程似乎很难找到.

This question is a part of my quest to learn Python and to learn LibreOffice macros, so any link to a general tutorial is welcomed. The tutorials on LibreOffice Python macros seem to be especially hard to find.

我正在使用 LibreOffice版本:4.1.3.2

推荐答案

尝试在/home/martin/.config/libreoffice/4/user/Scripts内手动创建一个子目录python(全部小写),然后将脚本放在此处.

Try to manually make a subdirectory python (all lowercase) inside /home/martin/.config/libreoffice/4/user/Scripts and put your script there.

这基于此wiki.openoffice.org文档.

这篇关于如何在LibreOffice中运行python宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆