开发者

Python--How do I write the value of a variable into the pasteboard in iPhone (iOS 4)/

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜