Python--如何将变量的值写入iPhone(iOS 4)中的粘贴板/
我在越狱的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在 Cydia 中安装 modmyi 存储库(默认启用)中提供的软件包“Erica Utilities”。
You need to install the package "Erica Utilities" available in the modmyi repository (enabled by default) in Cydia.