6 ms·
Show HN: Python on iOS Native Apps
- jventura 6y agoThis project is a base for which to add a python interpreter to a swift iOS project. It allows us to call python functions and get the resulting string, and then use the result in swift code (to update native widgets, etc.) As I'm a beginner in swift and iOS, I've documented all the process at https://github.com/joaoventura/pybridge-ios/blob/master/docs/references.md https://github.com/joaoventura/pybridge-ios/blob/master/docs.... I hope this allows me to share all the Python code in my Android app (https://play.google.com/store/apps/details?id=com.flatangle.charts https://play.google.com/store/apps/details?id=com.flatangle....), which uses the same technique but for android (https://github.com/joaoventura/pybridge https://github.com/joaoventura/pybridge)
- mason55 6y agoWill Apple approve apps that use this?
- nickmain 6y agoAs long as there is no downloading, side-loading or user editing of python code in the app then Apple doesn't care. There are limited exceptions for apps that teach programming, such as Pythonista.
- vaxman 6y agoThere is a great disturbance in the Force --youngling Jedis are practicing their https://CircuitPython.org https://CircuitPython.org ways on https://circuitpython.org/board/particle_argon/ https://circuitpython.org/board/particle_argon/ kits that have WiFi, BLE, NFC, TensorFlowLite local image/speech recognition and the ability to connect with all types and sizes of displays (ePaper to AMOLED, retinal projectors, touch, multitouch etc.) and interfaces to LTE (150/50Mbps) via https://www.dfrobot.com/product-1834.html https://www.dfrobot.com/product-1834.html as well as headphones, 3D-printed multi-module wearable cases, personal (airborne and ground based) drones, personal indicators and other interfaces that "New" Apple can't even begin to imagine in it's crummy foodcourt (where they fire their best for letting their little girls make a social media post that accidentally shows a prerelease build while hackers and 9to5Mac lay the entire next release bare for all the public). Time to port Blinka to iOS so that it can at least run this Future's apps using something like https://www.adafruit.com/product/2264 https://www.adafruit.com/product/2264
- vaxman 6y agohah, my Karma literally went negative after that post on Friday (I don't post much so downvotes hurt) --probably wasn't the part about Python takin' over the game ;) I have the same shirt as this poor guy... https://youtu.be/NeHFDf0zKs4 https://youtu.be/NeHFDf0zKs4
- vaxman 6y agoAre you okay with having your app's binaries string dumped by unknown parties where upon they find the underlying Python source code? Some basic encryption (or tokenization) would be better, since few would expect to go looking for it.
- jventura 6y agoA simple strategy is to include only the pyc or pyo files inside a zip file, and it will continue to work as well..
- Osmium 6y agoDoes anyone know the latest on the Swift-Python bridge from the TensorFlow team[0]? Is this still in development or usable for iOS apps? [0] https://www.tensorflow.org/swift/tutorials/python_interoperability https://www.tensorflow.org/swift/tutorials/python_interopera...
- wool_gather 6y agoI believe that you need the S4TF fork of the Swift compiler. It might be doable to swap it into Xcode as part of an alternate toolchain, but it's not likely to be easy.
- saagarjha 6y agoNote that Apple will not let you put an application built with an alternative toolchain on the App Store.
- nickmain 6y agoThis [0] is an equivalent/tracking project. I would be very interested if it gains iOS support. [0] https://github.com/pvieito/PythonKit https://github.com/pvieito/PythonKit
- serial_dev 6y agoSimilar (?) project where you can write Python code and create apps for iOS, and Android (and others) https://beeware.org/ https://beeware.org/ The talks from the author, Russell Keith-Magee, are very interesting, I learned a lot about how apps work.
- kapilvt 6y agoalso kivy ... https://kivy.org https://kivy.org but both of those are more ux oriented, and with a different focus than this afaics.
- jventura 6y agoAs the sibling commenter said, that project and kivy are geared to write android and ios apps entirely in Python. My approach is different. I have most of the business logic in Python (I share lots of code between a web app and an Android app I have) and write the UI logic in the platform’s native language. This means the apps are always using native UIs and use the platform toolchains, and I can use all tools available natively on the platform.
- appybois 6y agoDo you know how much using python and the framework adds to the binary size?
- miohtama 6y agoI am not that worried about the binary size, but please see this discussion regarding loading times earlier today: https://news.ycombinator.com/item?id=23338227 https://news.ycombinator.com/item?id=23338227
- jventura 6y agoThe answer to that post is mine, and i confirm that there’s some delay on start but on a moto g 2014 that i have it is ~3 seconds which is not much. By comparison, Outlook takes more than 10 seconds to start on my iphone 5s..
- jakear 6y agoThat’s pretty crazy re outlook. Takes about half a second on my 11. Clearly mine is newer, but over an order of magnitude is a lot.
- jventura 6y agoTested right now: 8 seconds of a white screen, then the blue logo appears for 2 seconds, and finally, at second 10, mails start to appear.. That is why I always test my apps on older hardware.. That, and because i only have old devices.. :)
- jakear 6y agoI noticed that if I quit the app via the usual mechanism, it takes less than a second to load. However if I fully power cycle the device it’s closer to 5 seconds.
- jventura 6y ago
- deleted 6y ago[deleted]
- thealistra 6y agoIs this even allowed by Apple guidelines? Isn’t it the same rule that banned Flash?