Search code examples
iphonepythonios4pyobjc

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.


Solution

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