- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我可以很好地连接套接字,但我听说当一切都在本地时使用管道会更快,所以我想尝试一下,但我无法连接。
我开始使用 Libre
> soffice --headless --invisible --norestore --nodefault --nolockcheck --nofirstwizard --accept='pipe,name=ooo_pipe;urp;'
而应该工作但不工作的最低限度的 python 脚本是
import uno
from com.sun.star.connection import NoConnectException
pipe = 'ooo_pipe'
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", localContext)
context = resolver.resolve("uno:pipe,name=%s;urp;StarOffice.ComponentContext" % pipe)
最佳答案
到目前为止,我一直使用套接字模式。刚刚通过命令在我的机器上测试了管道:
/usr/lib/openoffice/program/soffice.bin -accept='pipe,name=foo;urp;StarOffice.ServiceManager' -nologo -headless -nofirststartwizard -invisible
$ lsof -c soffice|egrep "pipe|foo"
soffice.b 6698 user 3r FIFO 0,8 0t0 15766935 pipe
soffice.b 6698 user 4w FIFO 0,8 0t0 15766935 pipe
soffice.b 6698 user 15u unix 0xffff88009773ed00 0t0 15767001 /tmp/OSL_PIPE_1000_foo
lsof 显示有一个命名的套接字 foo 并且可以在 Python 中获取连接。在实验开始时,有时不会生成 foo,因此会引发 com.sun.star.connection.NoConnectException。但是之后我不能再重复这个错误了。
多年来,我们一直在生产中使用套接字模式的 headless office,它非常稳定且速度足够快。看来这里的管道模式还是依赖于unix socket,所以我建议使用socket模式。
关于python - 使用命名管道连接到 LibreOffice,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9774410/
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想改善这个问题吗?更新问题,以使溢出。 4年前关闭。 o
我有一个包含多个列的表格。 我只想要 target 值与 alg 值不同的行。在这种情况下,target 是 1 并且 alg 是 0。因此,第 2、4 和 5 行应该保留,而第 3 行应该删除。如何
我有一个百分比表: A | B | C ------------------- 1| 12% | 22% | 42% ------------------- 2| 52% | 2%
我有一个 Libreoffice Calc 工作簿,其中有 60 多张纸,其中许多都有复制到它们的大量图像。我想用 Calc Basic 宏删除所有图像。我尝试了以下失败并出现基本运行时错误,提示 P
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 12 个月前关闭。 Improve
我有一个格式为 HH:MM 的时间值求和列。总和的格式为 [HH]:MM,可防止 HH > 23 时翻转。我希望将此值转换为十进制数表示形式。例如: A B 1 12
有没有办法将模板应用于现有文档? 它似乎只有在我创建一个全新的文档时才有效,而且我不想复制粘贴所有内容。 最佳答案 我正在寻找相同的解决方案。我发现的唯一一件事是一个 LibreOffice 扩展来做
LibreOffice Calc 中的什么公式将计算不同 Week_Number 出现的次数?答案应该是2。 最佳答案 这个问题之前已经被问过很多次了。一种方法是在 B6 中输入以下公式然后按 Ctr
假设我在 LibreOffice calc 中有以下电子表格: | A | B | C | D | ------------------- |1| 1 | 2 | | 2 | |2| 2 |
LibreOffice Calc 中是否有接受 的函数整数 x 和 整数 y 并以该位置吐出单元格的内容? 有一个功能ADDRESS吐出给定 [x;y] 的地址。问题是我不知道如何取消引用它。 最佳答
我希望能够在 LibreOffice Calc 中选择两个单元格,然后按某种魔术键,结果交换两个单元格的内容。 我怎么做? 我为 Excel 找到了这个解决方案,但它在 LibreOffice 中不起
我正在寻找一种使用 LibreOffice 的 Calc 从网站获取一些数据的方法。 我之前使用带有 IMPORTXML 函数的 Google 表格,但因为它非常不可靠,所以我想改用 Calc。 我的
我想从 LibreOffice Calc 中多次出现的字符中获取最后一次出现。 例如我有一个字符串 abc1ba2ac2adeaa43add .现在,如果我正在搜索 a它应该返回 18。 最佳答案 使
我想在 LibreOffice Calc(v5.4.4.2 但可以升级)中实现一些条件格式,以突出显示其值通过公式计算而不是直接输入的单元格。 例如,一个单元格包含 =A3 将突出显示,而 Hello
我想为 Libreoffice Writer 创建一个模板,其中包含应显示在所有页面上的信息的右列。 事实上,我想要一种右侧的页眉。 有什么办法可以解决我的问题吗? 最佳答案 您可以使用 anchor
我有一个 LibreOffice 3 电子表格(在 Ubuntu 11.04 上),其中有一列包含数百个超链接,这些超链接仅显示为“链接”。 我需要将这些转换为纯文本,或者更糟糕的是显示超链接而不是文
看起来您只能从“数据”->“排序”中选择 3 个条件。有没有办法(可能是程序化的)使用额外的标准? 最佳答案 不,不调整代码是不可能做到的。从理论上讲,调整它并消除此限制应该很容易。对于 3-5 版本
我需要提取“日期字符串”作为表示日期/时间数据的单独列。 | A | B | C -+-----------------
我在 Windows 计算机上安装了 LibreOffice。 LibreOffice 附带了捆绑的 python.exe(版本 3.3),允许您用 Python 编写 LibreOffice 宏。这
我在 .docx 文件中的方程是 当我将 word 文件保存到 .odt 时,这个等式变成了 如何避免这个反问号? 最佳答案 解决方案:编辑等式并在等号后键入双引号 ("")。 关于libreoffi
我是一名优秀的程序员,十分优秀!