Application python 3 สำหรับ iphone

Photo by Roberto Nickson on Unsplash

Having finished my first year at university, and being left with very little to do this summer, I eventually found myself diving back into the wonders of the programming world, teaching myself languages such as Python and JavaScript, and building fun little tools with them along the way.

Since I chose to study Mathematics at university, I ended up investing in Apple’s iPad Pro at the beginning of the year, so that combined with the Apple Pencil, I would be able to quickly make notes during lectures and then spend a few minutes effortlessly neatening them up in the library afterwards. It also meant that I could spend hours trying to figure out the solutions to each weeks problem set without having to waste a single sheet of paper!

As I became more and accustomed to using the iPad as a virtual notepad, I decided to put it to the test and use it as my go to software development tool at the beginning of the summer holiday, and I haven’t been able to stop using it since!

In this article I aim to highlight some of the most practical IDEs for python development on the iPad, and hopefully you’ll end up adding one of the programs in this list to your development tool belt.

Python for Data Science

Part of the Mathematics syllabus at my university involves Statistics, a subject I was never particularly fond of until I discovered its true potential with Python’s data science and machine learning libraries. Being an aspiring mathematician, I knew that this area of statistics would satisfy my interest for both mathematics and programming, so what better a way to use my knowledge of Python than to use Jupyter Notebooks to start learning how to use it for data science. This leads us to our first iPad app: Juno.

Juno

Juno is a clean, powerful and fully supported iOS application for displaying and editing .ipynb files (Jupyter Notebooks) right from the comfort of your iPad. Currently, it has support for many popular data science libraries such as NumPy, MatPlotLib, Seaborn, and Pandas, as well as upcoming support for Scikit Learn and Tensorflow. It boasts a clean and easy to use UI with full keyboard shortcut support for the iPad Pro’s magic keyboard, as well as all the functionality that you would expect to receive from any ordinary Jupyter notebook platform.

This is an exceptionally great tool not only for data science, but for python tasks in general, due to being fast and responsive, as well as being able to read notebook files from external file locations such as Dropbox, OneDrive, and even Adobe Creative Cloud!

Juno also has the ability to import external libraries for use within the IDE itself, and if no libraries can be installed, the extensions folder is accessible through the Files app on your iOS device. This means that libraries can be installed from the web straight into the Juno client, however not all libraries are fully supported in the Juno IDE, so take this information with a pinch of salt.

As great as all of this functionality is, it does however come at a hefty price of £14.99. I can say that it is worth every penny, but if you are not looking for a paid Jupyter Notebook IDE, do check out the popular alternative on the App Store: Carnets.

Carnets

Much like Juno, Carnets supports many of your favourite libraries, and supports external library extensions. It also sports a similar user interface style to the classic browser-based Jupyter, which may be more appealing to some users. Since this version is free however, it lacks some of the bells and whistles that Juno has to offer, for example:

  • External keyboard shortcuts are severely limited, for example there are no shortcuts for deleting cells or undoing actions.
  • External package support for Carnets is much more limited than that of Juno – packages can be installed, but are not always guaranteed to work.
  • The user interface is not properly optimised for use on an iPad, and can be a pain to use.

Whilst this does not put Carnets in a particularly good light, the application does have a couple of features up its sleeve that Juno does not have to offer, such as direct access to documentation through the task bar, widget support and finally the ability to save and revert to custom checkpoints. These are just the most important features, and there are likely to be more useful little quirks within the application, so I encourage you to try it out for yourself.

Python for Application Development

Since Python is a very popular and powerful tool used worldwide by enthusiasts and professionals alike, it would not come as a surprise to find this functionality on the iOS platform. Indeed, there is an application that allows you to write applications, plot graphs, perform hefty computations, and even write your own games that can be launched from the home screen of your Apple device. Behold, Pythonista!

Pythonista

When I first started looking for an IDE to use on my iPad, I noticed that there were a lot of paid ones which were practically the same as the default Python IDE for desktop, so I thought to myself – “this isn’t worth it, it’ll only be more stressful”. But then I came across Pythonista, and it was anything but!

Pythonista is a fantastic tool for writing and debugging Python code from the convenience of your iPad or iPhone. It includes a simple user interface with plenty of custom themes to choose from, access to python files from any location (including Dropbox), and the ability to have multiple python scripts open at once. Its automatic code completion paired with offline access to Python documentation makes writing within the IDE an absolute joy.

But aside from the glamorous themes and pages of built in documentation, Pythonista comes with a plethora of other features to justify its £9.99 price tag. Some of these features include, but are not limited to:

  • The ability to run your code using either Python 2.7 or 3.6.
  • The ability to run graphical programs inside the compiler using hardware accelerated rendering modules such as Python’s built in “scene” module.
  • The ability to plot graphs and save them as images using MatPlotLib.
  • Access to iOS’ built in “Shortcuts” app allowing users to place custom written programs on the users Home Screen.
  • Extensive keyboard support for the dedicated users like myself.
  • A unique UI editor for the aspirational designers looking to get started on iOS.

for me it has been a reliable and sturdy tool in my development toolbox for a few months now, so if you are looking into an app which allows you to develop on the go, then I highly recommend this one!

But perhaps you’re not looking to shell out a tenner for a Python IDE. I completely sympathise. Don’t worry, I’ve done my research (scrolling through free IDEs to find the one with the best rating), and I came across this one.

Pyto

Perhaps it’s no coincidence that Pyto is the top rated free Python IDE on the App Store, as it is very close in comparison to Pythonista. Not only is it a fantastic free alternative to Pythonista, it also runs native Python 3.8, as opposed to the centuries old Python 3.7…

Although it doesn’t include offline documentation, it does grant users access to multiple windows at once, which is a particularly compelling feature for users who have come from VS Code on the desktop. Not only that, it also features support for modules such as Sklearn, which none of the aforementioned IDEs support. If that’s not enough, you also have the ability to ‘pip install’ other Pypi modules.

Next up, Pyto features its own host of modules from UI modules allowing users to plot graphs with data science libraries like Matplotlib, and even access to device settings such as the users location. Much like Pythonista, there is also iOS Shortcuts support.

Python for Deep Learning

If Juno wasn’t enough for your data science needs – namely, you need something that gives you access to statistical modelling and machine learning libraries such as Sklearn or Google’s Tensorflow, then I’ve got you covered. You’ve reached the end of the line, and in return I present you with the most practical IDE of all.

Juno Connect

Before we go into the specifics, I should indeed confess that Juno Connect DOES NOT run natively on your iOS device. It is simply an IDE which allows you to connect to a service running Jupyter Notebooks. This could be your desktop computer at home, a Microsoft Azure server, or perhaps a private external server that you’re collaborating on.

With all that being said, Juno Connect DOES however grant you access to a familiar Jupyter Notebook interface, allowing the user to have multiple notebooks running at once. This does come as a relief after using Juno for a prolonged amount of time, since that IDE completely shuts down the notebook that you’re working in every time you want to open another one, and there’s no option to have multiple windows open at once.

Another huge relief is that since you are running your notebook from a server within this IDE, you have access to any Python library or extension (as long as your computer actually runs it). This means that you can use Scikit Learn or even Google’s Tensorflow right from the comfort of your iPad. Whilst the developers at Juno are working on bringing this to their native IDE, this is all we have to work with for the time being.

You can start a Jupyter notebook server on your desktop by using a client such as Anaconda, which is free to download and gives you access to Jupyter Notebooks, Jupyter Labs, and many more features. Simply run the Anaconda server, and type into the console:

jupyter notebook —-no-browser —-port=####

This will run a jupyter notebook server without opening the browser from your device so that devices on the network can connect to it. Make sure that you actually type a port number rather than #### into the console. The default is usually 8888, so you can go ahead and leave this blank. To connect to this server, use the IPV4 address of your device on the network. There are a few more steps involving setup server side, so take a look at their official webpage:

https://juno.sh/direct-connection-to-jupyter-server/

Now that you’re all set up, you can go and fulfil your deep learning needs from your sofa, or even on the go, should you decide to port-forward.

Like all of the previously mentioned IDEs, I should mention the free alternative, but this time I did not have any luck other than finding a feature built into Carnets that allows the user to connect to a remote server, so if you are really interested, do check this out for yourself.