Python--如何将变量的值写入iPhone(iOS 4)中的粘贴板/

发布于 2024-09-13 12:01:04 字数 448 浏览 5 评论 0原文

我在越狱的 iPhone 3GS 上运行 iOS 4。在升级到 iOS 4 之前,我在 iPhone 上安装了 Python,并找到了以下 Python 代码片段,用于将变量(在本例中为键)复制到粘贴板。然后,我可以打开另一个应用程序并将该值粘贴到文本字段中。

out = os.popen('\usr\bin\pbcopy', 'w')
out.write(key)
out.close()

自从升级到 iOS 4 后,此代码不再有效。我收到以下错误消息:

sh:pbcopy:找不到命令

我查看了 \usr\bin\ 目录,没有列出 pbcopy (或 pbpaste)命令。

有谁知道我可以使用 Python 将变量的值复制到粘贴板的另一种方法吗?

我非常感谢任何人可以提供的任何帮助。

I am running iOS 4 on a jailbroken iPhone 3GS. Before I upgraded to iOS 4, I had installed Python on the iPhone and had found the following snippet of Python code to copy a variable (key in this case) to the pasteboard. I then was able to open another application and paste the value into a text field.

out = os.popen('\usr\bin\pbcopy', 'w')
out.write(key)
out.close()

Since upgrading to iOS 4, this code no longer works. I receive the following error message:

sh: pbcopy: command not found

I looked in the \usr\bin\ directory, and there is no pbcopy (or pbpaste) command listed.

Does anyone know of another way that I can use Python to copy the value of a variable into the pasteboard?

I'd greatly appreciate any help that anyone can provide.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灯角 2024-09-20 12:01:04

您需要在 Cydia 中安装 modmyi 存储库(默认启用)中提供的软件包“Erica Utilities”。

You need to install the package "Erica Utilities" available in the modmyi repository (enabled by default) in Cydia.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文