Working with Python sources

Juno was designed to make working with Python scripts on your iOS devices intuitive and seamless, with as few compromises as possible. It offers more than just a code editor: it creates a workspace, where everything you may need is within easy reach. This workspace packs a lot:

  • A fast and versatile code editor with snappy, intelligent code completion;
  • A console with full terminal emulator support;
  • A built-in media viewer for code outputs, perfect for displaying images generated by Pillow, Matplotlib plots, Bokeh web apps, and more;
  • A working directory browser, which lets you seamlessly navigate, view, and edit files in the working directory without leaving your editor.

Learn more about navigating the working directory here: Working directory browser.

Code editor
Run configuration
Console
Media viewer
Web browser

Overview

Juno's Python source workspace

Juno lets you run Python scripts (i.e., .py source files) using its built-in Python environment. Juno’s environment comes with many industry-standard Python libraries and tools pre-installed, and you can also easily install any pure Python package using Juno’s package manager.

Code editor

The code editor lets you work with Python sources with syntax highlighting, snappy, intelligent code completion (driven by Jedi), and powerful Find and Replace.

Juno's Python source code editor

The editor extends your on-screen keyboard with additional buttons and actions, and offers a customizable toolbar, where you can rearrange, add, or remove items by selecting Customize Toolbar in the editor’s Ellipsis circle icon overflow menu. For example, you could disable the floating run button and add a Run/Stop button group to the toolbar instead.

Back to top

Run configurations

Juno's Python source editor run configurations

Long-pressing the floating run button, or selecting Configure Run… in the toolbar, lets you configure certain script execution parameters, such as the command line arguments passed to the script.

More configurations are coming soon, such as managing, activating, and deactivating environment variables when running the script, and more.

Back to top

Console

The console is displayed in the trailing sidebar and handles standard output and input. It has full terminal emulator support, so you can use most standard ANSI escape sequences to manipulate output, add formatting, and even create rich terminal applications.

Juno's Python source workspace console

You can toggle the console with the Console sidebar icon button, or swipe from the screen edge while the console is hidden to reveal it as an overlay on top of the editor (works on iPhone, too!).

Quick actions let you easily toggle light and dark mode for the console only, copy console contents as text, or clear the console.

Back to top

Media viewer

Juno's Python source workspace media viewer

When your code attempts to display some code-generated media—say, a plot created with Matplotlib, or an image generated with Pillow—Juno will display a media viewer, where you can view, annotate, or save the output as a file.

Back to top

Web browser

Juno's Python source workspace web browser

Juno provides a built-in web browser, which you can open from code using Python’s webbrowser module. For example, running a Python script with this code snippet will open an overlay web browser pointing to the 127.0.0.1:5000 address:

import webbrowser

webbrowser.open_new("http://127.0.0.1:5000/")

Back to top