4

I want to use a python library https://github.com/yann2192/pyelliptic in iOS to encrypt/decrypt.

I've gone through the following posts:

Is that possible to run a python built program on iOS as a static lib?

Embedding Python in an iPhone app

But found no luck.

Is there any way to do so?

Community
  • 1
  • 1
SandeepAggarwal
  • 1,273
  • 3
  • 14
  • 38
  • What errors are you getting? – sgp May 27 '15 at 08:41
  • I am not getting a way how to use the library in objc code – SandeepAggarwal May 27 '15 at 08:42
  • What does "found no luck" mean? What did you try? What happened? If you successfully embedded Python in your ObjC app, then the way to use it from ObjC code is the same way you use it from C code, which is described pretty nicely [in the official documentation](https://docs.python.org/3/extending/embedding.html). – abarnert May 27 '15 at 09:01
  • But meanwhile, why would you want to do this? `pyelliptic` is just a wrapper around OpenSSL, which is already available on iOS and which you can talk to directly as a C library. – abarnert May 27 '15 at 09:02
  • @abarnert I couldn't find any wrapper for openSSL in ios for ecc curves.Can you please let me know this? – SandeepAggarwal May 27 '15 at 09:06
  • @SandeepAggarwal: I don't know of any high-level ObjC wrapper, but you can just call the OpenSSL C functions yourself, the same ones `pyelliptic` calls. It's not that complicated. Certainly a lot less complicated that embedding Python just so you can call a Python wrapper around those functions. – abarnert May 27 '15 at 09:07

1 Answers1

-1

I use pythonista on my iPad and works perfectly with libraries compatible with python 2.7. If the library you wan to use depends only on the standard library (also numpy and matplotlib are supported) then it's easy (dependency to other libraries can be solved too, but takes more work). Simply, you need to copy/paste the library source in a plan script into pythonista and then you can import it from your script also running in pythonista. I am sure there are other software that do the same but I have experience only with that one.

alec_djinn
  • 10,104
  • 8
  • 46
  • 71
  • Look also here, is a simple module to install pypi packages on pythonista http://omz-software.com/pythonista/forums-old/discussion/237/pypi-installer-and-web-server/p1 – alec_djinn May 29 '15 at 12:53
  • Is there a library that includes sty for iOS devices such as iPhone 5s? I have the app Python Box, and it works perfectly fine, but it does not include the sty module. – Dan Dec 21 '18 at 21:52