What’s New in Pythonista#
This page contains detailed information about changes in new versions of the Pythonista app.
Pythonista now supports Python 3.10, so you can use structural pattern matching, assignment expressions (added in 3.8), and many other new language features and improvements in the standard library. See What’s New in Python 3.10 for details.
Python 2.7 is no longer included. Official support from the PSF has ended in 2020, so this has been coming for a long time. In case you still have Python 2.7 code, the 2to3 tool is still available from the wrench menu.
Shortcuts integration: You can now use Pythonista scripts as actions in Apple’s Shortcuts app, without launching the app. You’ll find more information in the
shortcutsmodule documentation and on the App Extensions and Shortcuts page.
Improved documentation with modernized theme, dark mode support, and additional content about third-party libraries.
Pythonista now requires iOS 12 or later.
Improved support for the Magic Trackpad (and other pointer devices) on iPadOS.
New text selection gestures in the editor for iOS 13+ (closer to system text gestures).
Fixed an annoying issue with the up/down arrow keys not working correctly in the editor.
Fixed an issue with the “dock accessory panel” button disappearing sometimes.
Version 3.3 (2020-02-20)#
If you’ve been using the beta, you may notice that the “Siri Shortcuts” feature is missing from this release. It’s still planned, but the beta implementation was based on already-outdated iOS 12 APIs, and I want to take a little more time for a version that makes use of new iOS 13 features like custom parameters. Thanks for your patience! There’s still a lot of new stuff to discover in this update.
Support for dark mode on iOS 13 – you can now select separate themes for light/dark mode, and Pythonista will switch automatically between them. Switching between themes is also a bit faster now.
- New scriptable keyboard extension and associated
First off, this is not intended to replace the system keyboard or your preferred third-party keyboard for most of your typing. It’s much more like the emoji picker, i.e. you’d typically switch to it just for specific tasks. The keyboard does not support any kind of AutoCorrect or QuickType suggestions. Just switch to the system keyboard if you need those (hold the ‘globe’ key).
You can enable the keyboard in the Settings app (General > Keyboard > Keyboards > Add New Keyboard). It already includes various script shortcuts from the examples folder that you can try right away. If you want to add your own scripts, use the new “Shortcuts…” option from the ‘wrench’ menu.
You can use the keyboard for simple things, like quickly inserting the current date/time in your favorite format, or even show a custom UI, like a calculator, in the keyboard view (or above a standard QWERTY keyboard). Have a look at the included examples to get an idea of what’s possible.
keyboardmodule includes keyboard-specific functionality for inserting text, modifying the cursor position, showing user interfaces in the keyboard, and more.
Generally, the Pythonista keyboard does not require that you enable ‘Full Access’, but you can’t use some functionality in your scripts then (e.g. clipboard or network access).
- Note: If you have a hardware keyboard connected to your iPad, and the Pythonista keyboard does not show up on screen when you select it, please tap and hold the
˅button in the bottom-right corner of the screen.
Lastly, this feature is somewhat experimental, and not all modules are available within the keyboard. Have a look at the new Keyboard examples to see what’s possible.
- Note: If you have a hardware keyboard connected to your iPad, and the Pythonista keyboard does not show up on screen when you select it, please tap and hold the
- New scriptable keyboard extension and associated
Improved and unified UI for creating script shortcuts in the new Pythonista keyboard, the share sheet extension, editor actions, and home screen icons, all from one place: The new “Shortcuts…” option in the ‘wrench’ menu. This also contains a new Pythonista URL generator for creating various kinds of
pythonista3://...URLs and QR codes more easily.
- Significantly improved support for external keyboards across the entire app:
A lot of new keyboard shortcuts are available – on iPad, you can view a list of shortcuts by holding the Cmd key (as you probably know), so I won’t list them all here. Keep in mind that the shortcuts depend on the current context, i.e. you’ll see different shortcuts in the script library, editor, console, etc.
Many parts of the app (e.g. the script library (
O), editor actions (
U), settings (
,) …) now support selection using the up/down arrow keys on hardware keyboards (and return to select). Where arrow key navigation is available, you can also go to the parent folder/view with
The arrow keys can now be used for scrolling in the editor, when you’re not typing. You can scroll entire pages with space/shift+space, Cmd+up/down scrolls to the top/bottom.
Cmd+W also closes most modal dialogs (in addition to tabs) now, including
ui.Viewinstances of your own scripts.
The keyboard shortcuts Cmd+Alt+[1-9] are automatically assigned to editor action scripts you’ve added.
Improved behavior of Cmd+return shortcut: You can now use it to toggle (and not just begin) editing, and it also works in the console.
Cmd+[1-9] switches tabs (Cmd+1 shows the first tab, Cmd+2 the second…)
The outline (list of functions) in the editor can now be filtered – just start typing if the keyboard is already active, or drag down the list to reveal the filter text field. The filter supports fuzzy matching, and you can also enter a line number.
Support for opening external folders using the system’s file picker.
Support for iOS 13 “Full Page” screenshots in the editor.
notificationmodule with support for custom actions (buttons), location-based and repeating notifications, and more. The module also works in Pythonista’s app extensions now (it was previously main app only).
The console’s history is now persistent (i.e. saved when you quit the app). You can also delete the console history by tapping and holding the ‘^’ button now.
The documentation supports multiple tabs now.
Scripts stored in iCloud are now compatible with the built-in “Run Script” and “Edit Script” actions of the (Apple) Shortcuts app. Just prefix the script name/path with “iCloud/”, e.g. use “iCloud/MyScript.py” (without quotes). Note: This integration soon won’t be available anymore, but you can get equivalent functionality by using “Open URL” actions with the new Pythonista URL generator in the “Shortcuts” menu.
The “Quick Help” menu option is also available in non-Python files now (e.g. Markdown-based documentation), and there’s a new button to jump to the full documentation from the quick help popover.
shortcutsmodule (currently just for generating
pythonista://URLs, but more is planned).
photos.capture_image()function with the option to use the selfie camera by default.
Added support for defining keyboard shortcuts in custom views (see
Changed the default file type for
dialogs.pick_document()to ‘public.item’ (instead of ‘public.data’, this works better for unknown file types).
Fixed a crash when saving images from the console when access to the photo library has not been granted yet.
Fixed an issue with the extra key row hiding console input on 2018 iPad Pros.
Fixed a crash when using arrow keys on an external keyboard while the on-screen keyboard is visible.
Fixed problems with using iCloud scripts in the share sheet extension.
Fixed triple-quoted byte strings and f-strings not being syntax-highlighted correctly.
Fixed ‘wrench’ actions not being saved when invoked from the script library.
Selecting Python 2.7 as the default interpreter shows an “end of life” warning now (Python 2.7 will cease to be officially supported by the Python Software Foundation in 2020).
Version 3.2 (2017-12-30)#
Main New Features#
Pythonista now uses Python 3.6.1 instead of 3.5. Among other things, this release brings support for f-strings, which make string formatting much easier and more intuitive. In the code editor, embedded expressions in an f-string (enclosed in curly braces) get a slightly different background color, and code completion is available within those expressions.
Scripts can be stored in iCloud now.
Added support for opening external files (from other apps) in-place, using the document picker.
Added “Open in…” menu support for opening Python scripts from other apps. If the sending app supports it, files are opened in-place (otherwise they’re imported to Pythonista’s script library).
Added support for importing files from other apps using drag’n’drop (iOS 11 only).
Files can be moved within the script library via drag’n’drop (iOS 11 only).
Improved search in the script library (also searches subfolders now).
New “Favorites” section to bookmark files and folders for quick access (e.g. when you have a deep folder hierarchy). On iOS 11, files in the script library can be marked as favorites with a right swipe action.
Improved support for iPhone X.
Removed the “thumbnail style” tab UI on iPhone. The tab bar UI is now essentially the same as on iPad, with some minor layout changes to make it work well on narrow screens.
When creating a plain text, HTML, or Markdown file, you can now enter a custom file extension (the default extension won’t be appended).
“Convert Tabs” is now “Reformat Code”, and supports applying coding style guides in addition to .
Read-only files (e.g. standard library) are now marked with a lock icon in the editor.
“Marker” comments (#todo/#fixme etc.) show up in the outline popup now.
The “insert asset” button is now shown above the keyboard (while editing) instead of in the main toolbar.
The URL scheme supports a new
?exec=...parameter that allows creating URLs that contain encoded Python source code. It is also possible to create an “exec” URL directly from a script in the editor (“Wrench” -> Share -> Create Executable URL).
Fixed: Scripts that are launched via URL scheme (or homescreen shortcut) when the app isn’t running yet could have an incorrect working directory in some cases.
When a script is launched via URL scheme, but the interpreter is busy, the script is now queued for execution instead of simply failing to run.
pythonista3://URL scheme has an additional “root=[icloud|local]” parameter opening/running scripts in iCloud.
Changes in Built-in Modules#
arrowmodule (easy-to-use date/time manipulation).
openpyxlmodule (reading/writing Excel documents).
appex.get_web_page_info()function for accessing information about the current web page when invoking the share sheet extension from Safari. This includes the page’s HTML code (constructed from the current DOM), selected text, cookies, and some other things that couldn’t be inferred from the URL alone.
Fixed a potential crash when using
appex.get_text()from the Notes app.
Fixed crash in
console.quicklook()when passing multiple paths (Python 3).
dialogs.pick_document()function for importing files using the system document picker.
sound_nameargument for notification.schedule supports all bundled sound effects now.
sound.Playerhas a new
finished_handlerproperty isn’t new, but was previously undocumented.
ui.View.present()has a new
hide_close_buttonparameter (use with caution, you may end up with a UI that you can’t close without force-quitting the app).
ui.Viewsubclasses, you can now implement an
update()method (no arguments, except for self) that gets called automatically by an internal timer. To make this work, you also have to set the new
ui.View.update_intervalattribute. It specifies how often the timer fires (e.g. set to 1.0, the timer fires every second). It defaults to 0.0 (disable update timer) because otherwise this new feature might break existing code that happens to implement a method called update.
webbrowsermodule is a lot more compatible with other platforms now, and it supports a couple of 3rd-party web browsers directly (example:
Fixed text rendering glitches in settings on iPhone.
Fixed “Copy”/”Open in Editor” buttons (in documentation) on iOS 10.3
The Python interpreter is now built with IPv6 support. This should fix connectivity issues people were experiencing on IPv6-only networks (e.g. T-Mobile U.S.)
You can select an alternative app icon in the theme settings.
Opening a file that is already open in a different tab switches to that tab instead of opening the file twice.
Improved file browser in the app extension, and when picking scripts for editor actions (essentially the same as the main library now).
The “open in new tab” swipe action is accessible with a right swipe (iOS 11 only). Instead of tapping on the button, you can also just continue the swipe gesture.
When restoring tabs from a previous session, the selected tab is restored as well now.
Added hardware keyboard shortcuts for switching, adding, and closing tabs.
Improved scrolling behavior when selecting a function from the outline.
When a script has annotations (style checker warnings etc.), the number of annotations is now shown after the filename.
Creating a new file from an empty tab uses the currently selected folder in the library now.
Files that are opened from other apps via “Open in…” menu are now opened in new tabs.
Added a “launch in safe mode” setting that is accessible from the Settings app. This disables running pythonista_startup and restoring tabs from the previous session. It’s meant for troubleshooting purposes, i.e. when the app fails to launch, and only applies to the next launch.
Version 3.1 (2017-01-19)#
The console contains a new object inspector panel that allows you to view a list of all global variables and their attributes/members. Tap the (i) button to show or hide it.
The new Pythonista Today widget allows you to run a script in Notification Center (or on the home/lock screen). You can find more information in the
appexmodule documentation, and various examples of widget scripts are available in the updated Examples folder.
The Python 2 mode now uses Python 2.7.12 instead of 2.7.5.
When using the share sheet extension with a file input (e.g. sharing a Mail attachment), an additional “Import File” option is shown for non-Python files.
speechmodule contains new functions for speech recognition, in addition to speech synthesis (iOS 10 only).
The “Analyze (pyflakes)” and “Check Style” commands are now accessible from the “wrench” menu instead of by tapping and holding the run button.
Tapping and holding the run button offers a new “Run Unit Tests” option. This discovers and runs tests in the current script using
pytestand shows test results directly in the editor.
“Wrench” menu actions have a new “Reset Environment” option. When this is enabled, running the action behaves like running the script from the editor, i.e. global variables, imported modules etc. are cleared.
Version 3.0 (2016-06-14)#
Support for both Python 3.5 and 2.7
Integrated debugger with support for breakpoints and visual stack frame inspection
Split-screen support on iPad Air 2 and later
Theme editor for custom UI and syntax highlighting themes
Integrated doctest support
Integrated PEP-8 style checker
Improved code completion with fuzzy matching and user-defined snippets
photosmodule, including editable metadata, album creation, content editing, and more
Python 3 Suppport#
Pythonista now supports Python 3.5, in addition to 2.7. You can select the default interpreter in the settings. It’s also possible to override the default interpreter for individual scripts, using a “shebang” like
#! python2as the first line of a script. Alternatively, you can tap and hold the run button to test a script in the non-default Python version. To help you with migrating your scripts to Python 3, you can use the “Python 2 to 3” tool in the “wrench” menu.
To learn more about the differences between Python 2.7 and 3.x, I recommend the following article (external link): The key differences between Python 2.7.x and Python 3.x with examples.
If you also have Pythonista 2 installed, you can access your existing files through the special “Pythonista 2” folder in the script library. It is possible to move files from Pythonista 2 to Pythonista 3, but not vice-versa.
The interactive console uses the default interpreter version, but you can switch to the other interpreter by tapping the
[3.5]button (depending on the current setting).
When using the URL scheme to launch Pythonista, you can now use
pythonista://. The old scheme is still supported, but its behavior is undefined if both Pythonista 2.x and 3.x are installed.
On iPad Air 2 or later (including iPad Pro and iPad mini 4), Pythonista now fully supports the system-wide split-screen feature, so you can run another app next to Pythonista. Unfortunately, this also means that the
ui.View.present()no longer works on devices that support split-screen, i.e. you can’t lock the orientation of a view to portrait or landscape. If auto-rotation isn’t disabled via Control Center, the app always auto-rotates. It is currently not possible to change this due to iOS limitations.
Script shortcuts can now be added to the home screen from the editor actions (“wrench”) menu. This basically works by setting up a website that redirects to a pythonista3:// URL, so the actual shortcut is added from Safari. The Convert to PDF action has moved into the Share menu.
Improved support for
doctesttests – a new file template allows you to create a doctest file in Markdown format. There’s more information about this in the template itself. Doctest results are shown as annotations directly in the editor.
You can now add your own templates to the “New File” menu. Simply add files to the Templates folder (in the Modules & Templates group).
The view options for the script library (thumbnails, sort order) are now accesible directly in the library view (”…” button).
Script shortcuts of the sharing extension can now be edited in the main app’s settings as well.
Added a Sound Effects setting to disable keyboard clicks etc.
Various “special” folders (standard library, site-packages) are now grouped under “Modules & Templates” in the script library. Note that this doesn’t change the location of these folders on disk, so the site-packages and Templates folders still appear directly under “Documents” in the “Move Files” dialog.
There are now separate site-packages folders for the two interpreter versions. site-packages-2 is only used by Python 2.7, site-packages-3 only by 3.5. The old site-packages folder still exists as a fallback for both interpreters.
Pythonista now includes a real debugger with support for breakpoints and visual stackframe inspection. This also replaces the traceback navigator, and enables more advanced “post-mortem” debugging when an exception occurs.
To start breakpoint debugging, you have to add at least one breakpoint to your script (from the copy/paste menu). If a script contains breakpoints, tapping the run button will automatically offer a “Debug” option. The debugger is also shown in “post-mortem” mode when an unhandled exceptions occurs.
The debugger UI appears as an overlay “window” on top of everything else, so that it’s possible to use it e.g. while a full-screen UI is presented. You can drag the debugger around on the screen if it gets in the way.
To get more information about variables and stack frames, you can expand the debugger UI. The Variables tab shows you all local and global variables in the selected stack frame, and you can expand objects (using the triangle buttons) to show their attributes (or members, in case of sequences or dicts), which makes it possible to inspect nested data structures. Tapping on a variable name shows a string representation, similar to
repr(var). For certain types of objects, a preview image is shown instead – this currently works for
ui.Path, and it’s indicated by an “eye” icon in the list.
You can now define snippets in the settings to insert frequently-used pieces of (boilerplate) code more quickly. When you set an abbreviation for a snippet, it shows up in the code completion suggestions. You can also select from a list of snippets in the editor using the copy/paste menu (with an empty selection) or the Cmd+D keyboard shortcut. Note: Snippets are only supported in Python files.
The Convert Tabs action is now undoable, and the confirmation dialog has a new option to open the indentation settings.
Code completions can now be suggested based on fuzzy matching, e.g. typing “rage” also suggests “range()” (fuzzy-matched completions are always shown after precise matches).
When using an external (Bluetooth) keyboard, code completions can now be selected with the up/down arrow keys.
A new Cmd+L (or Ctrl+6) keyboard shortcut shows the current file’s outline (while editing) – The up/down arrow keys and return can be used to navigate to a different function without touching the screen.
New Cmd+Shift+B shortcut for adding/removing breakpoints.
When text is selected, pressing the tab key will now indent the selected line(s) instead of replacing the selected text with a tab. Shift-tab can be used to unindent on an external keyboard. On the on-screen keyboard, you can tap and hold the tab key for an unindent option. Indentation options are no longer shown in the copy/paste menu by default, but you can re-enable them in the settings (under “Keyboard & Typing”).
The color picker (in the UI editor and asset picker) now allows entering arbitrary hex values by tapping on the color swatch.
Integrated PEP8 style checker: You can check a script by tapping and holding the ▷ (run) button. Various options for customizing the rules are available in the settings. Issues are highlighted directly in the editor.
Integrated pyflakes static analyzer: Similar to the PEP8 style checker, you can invoke this by tapping and holding the ▷ (run) button. The analyzer can find unused imports, undefined variables, and similar issues, which are also highlighted directly in the editor.
When running a script with arguments (by tapping and holding the run button), the arguments are now saved for each script individually. When the current script has any saved arguments, they are also used for running the script normally (i.e. by just tapping the run button). The icon of the run button changes slightly to indicate whether there are arguments for the current script.
Line numbers can optionally be shown on iPhone as well (line numbers were previously iPad-only).
On iPhone, the “show tabs” button is now at the bottom of the screen (or above the keyboard), so that the editor actions (“wrench”) menu is more easily accessible in the main toolbar.
The search bar in the editor now uses the same extra keyboard row as the editor itself.
New “Line Length Warning” option (under Indentation & Coding Style). When enabled, the end of long lines is highlighted. The maximum line length can be customized (79 by default).
Improved console prompt: The text input area now expands automatically for multi-line statements (e.g. function definitions, loops). The code completion behavior is also more consistent between the editor and console now (e.g. the tab key inserts the first suggestion).
Showing images in the console has been improved substantially. A single tap on an image now opens it in a zoomable full-screen view. The sizing of image containers also matches the aspect ratio of the shown images more closely, especially when the console is in the more compact “docked” mode.
editor.open_file()now accepts both relative and absolute paths (relative paths are always resolved against ~/Documents though, not the current working directory).
editor.annotate_line()function to annotate lines of code in the editor, similar to the integrated style checker and static analyzer.
Views that are presented in ‘panel’ style can be closed programmatically now (the
ui.View.close()method was previously ignored for this presentation style).
ui.WebViewcan now load non-https pages in the app extension.
ui.WebView.load_urlnow treats absolute file paths like file URLs (so you don’t have to construct a
file://URL for loading local files).
copy.copy()now works correctly for geometry types (
Added support for MFi game controllers (see the module docs for details).
anchor_pointcan now be passed as a keyword argument to the
LabelNoderendering quality is improved.
path=Noneno longer throws an exception.
texture=Noneno longer throws an exception.
The behavior of
sys.exit()has changed: Registered
atexithandlers are called, but nothing else happens (previous versions printed the exit code to the console). If you really want to exit the app, use
The editor no longer strips trailing blank lines when saving.
The console has (limited) support for the
\rcontrol characters now. The most common use case would be simple progress displays that overwrite the last line that was printed. Note that (unlike in a real terminal) these control characters only have an effect within a single string. Printing should also be a bit faster, and a couple of issues with
When a script is running in the background for longer than iOS allows (about 3-4 minutes), the app should usually be suspended now (previously, it was killed immediately).
It’s now possible to open folders in the library using the URL scheme. The syntax is the same as for opening files (pythonista3://some/path?action=open).
Version 2.0 (2016-01-11)#
Pythonista is now compatible with all iOS screen sizes – from iPhone 4 to iPad Pro, and everything in-between.
For larger projects, you can now use multiple editor tabs to switch between related files more quickly.
The Pythonista app extension allows you to run Python scripts directly within other apps, using the standard iOS share sheet. Depending on the context, you can use the new appex module to access data that was passed to the share sheet, e.g. images in the Photos app, URLs in Safari, text in Notes, etc. The app extension also provides an interactive console and a basic code editor for small tweaks.
New and refined color themes are available in the settings; selecting a different theme now changes the entire app’s UI instead of just syntax highlighting.
Additional templates are available in the improved “new file” menu. You can also import photos from your camera roll as image files there.
The console’s interactive prompt is now syntax-highlighted, and provides better support for Bluetooth keyboards (you can use the up/down keys to navigate the command history).
You can now read the (pure Python) source code of the included standard library (and third-party modules) directly in the app. Simply enable the “Show Standard Library” setting if you’re interested in looking “under the hood”.
The UI editor contains a much improved inspector panel, undo/redo support, the possibility to set custom attributes, and a lot of other refinements.
The new traceback navigator allows you to get a lot more information about errors in your programs. When an exception occurs, a brief summary is shown at the top of the screen, and the line where the exception occurred is highlighted in the editor. By tapping on the exception summary, you can navigate the entire traceback, even if the source of the exception is in a different file. You can also tap the
<...marker in the editor to inspect variable values in the selected stack frame.
The editor actions (“wrench”) menu has been improved significantly. You can now assign custom icons and colors to your script shortcuts. It’s also possible to invoke the standard iOS share sheet from the actions menu. If you have an iPhone 6s or 6s Plus (with 3D Touch), you can launch shortcuts directly from the homescreen by pressing the Pythonista icon.
The improved asset picker (
[+]button) contains more free image and sound effect collections that can be used with the
soundmodules. The UI for opening the asset picker is also consistent between iPad and iPhone now.
When the cursor is inside a color string (e.g. ‘#ff0000’ or ‘red’) or built-in image name, a preview overlay is shown automatically. You can also tap the preview overlay to select a different color or image.
The new Highlight All option in the copy/paste menu allows you to quickly find all occurrences of a word (e.g. variable name), without typing anything in the search bar.
You can adjust the indentation of a selected block of code more easily with the new
⇥ Indentmenu items (in the copy/paste menu).
iPad only: The extended keyboard has a more compact layout by default. If you prefer a larger keyboard with an additional number row, you can enable this in the settings.
Python / Modules#
The completely revamped
scenemodule gives you a lot more possibilities for building 2D games and animations in Pythonista. You can even use custom OpenGL fragment shaders. Lots of new sample code and a tutorial for building a simple game are available in the included Examples folder.
ctypesmodule from the standard library is finally available in Pythonista, and the custom
objc_utilmodule uses this as the foundation for an Objective-C bridge that makes it possible to call native APIs using familiar Python syntax. A few sample scripts are included in the Examples folder.
You can customize the startup process of the Python interpreter by creating a file named “pythonista_startup.py” in the site-packages folder. When the app is launched, the interpreter will execute this module, so that all variables/functions/classes in the script become available globally. A common use case might be
from math import *(if you want to use the console as a calculator). Note: If Pythonista becomes unusable due to a misbehaving startup script, you can launch the app in a “clean” state by entering
pythonista://in Safari’s address field.
Version 1.5 (2014-06-16)#
You can no longer use the “Open in…” menu from other apps to open files in Pythonista. This change was made in order to comply with Apple’s app review guidelines.
Xcode export is currently not available from within the app. I’m working on a way to create Xcode projects from Pythonista scripts on a Mac instead; details will be available on the Pythonista website soon.
Smarter code completion – in situations that the old completion system couldn’t handle, Pythonista is now using the jedi library. This applies to things like instance members, where the type of the object can be inferred. The extended code completion can be somewhat slow, depending on your device generation and the size of modules you’re working with. It should get faster over time, as caches are built, and the old completion system continues to work while you’re waiting for jedi results, but in case you find this impacting the overall performance of the app and your scripts, you can disable extended completion separately in the settings.
The documentation is now shown in the same panel as the console (this also applies to the built-in web browser used by the
The keyboard shortcut for switching between editor and console is now Cmd+J instead of Cmd+<Space> (the previous shortcut conflicted with switching the keyboard language).
The integrated documentation has a new look.
User-created modules are now reloaded automatically when running a script.
New site-packages folder that is included in the default
sys.path(this is a good location for shared modules that you want to import in scripts across different folders). Please note that the aforementioned automatic reloading doesn’t apply to modules in this folder (in order to improve performance).
Python / Modules#
uimodule for creating native user interfaces on iOS, including an integrated UI editor.
motionmodule for accessing the device’s motion sensors (accelerometer, gyroscope, magnetometer).
notificationmodule has a new
Various improvements in the
photosmodule, especially the
photos.pick_image()function (new keyword arguments for multiple selection, including metadata, and returning raw data instead of decoded images)
Updated various modules to the latest PyPI versions (
bottle: 0.11.4 → 0.12.5,
bs4: 4.1.3 → 4.3.2,
feedparser: 5.1.2 → 5.1.3,
html5lib: 0.95-dev → 0.999,
markdown2: 2.1.0 → 2.2.1,
paramiko: 126.96.36.199 → 1.13.0,
pygments: 1.5 → 1.6,
pyparsing: 1.5.7 → 2.0.1,
requests: 1.2.2 → 2.2.1)
Fixed incorrect behavior of up/down arrow keys (on hardware keyboards) after changing the selection via tap.
Fixed a bug that caused indentation errors to be silently ignored (the script failed to run, but no error message was shown).
Fixed a potential crash with photos.get_metadata on Chinese iPhones.
Fixed a potential crash when the recursion limit was exceeded.
contactsmodule can now retrieve the birthday of a person if the year isn’t set (the year component will be in the distant past in this case); this previously raised an internal exception.
Version 1.4 (2013-11-25)#
Complete UI overhaul for iOS 7.
The interpreter is now based on Python 2.7.5.
There’s a new setting to use spaces (“soft tabs”) instead of tab characters for indentation. The new “Convert Indentation…” action can be used to change the indentation of an existing script to the current setting.
The action menu is now directly editable, without having to open the settings. It is also possible to add scripts in folders as actions, and actions can have custom command-line arguments.
Non-Python files are now visible in the script library. Plain text files can be edited, for other files, a QuickLook preview is shown.
All scripts are now run in the same interpreter that is also used for the interactive prompt. This makes the console a lot more useful because you can now define functions, classes, etc. in a script and experiment with them directly, without having to use
execfile(). It also makes starting scripts a lot faster in most cases because imports are cached. By default, all global variables are cleared before running a script, but there’s a new setting to control that behavior in the “Interpreter Options” section. If you want to completely reset the interpreter, you can do that by tapping and holding the “Clear” button in the console.
There’s a new option to always clear the console before running a script (in the “Interpreter Options” section of the settings).
Tapping and holding an auto-completion suggestion now shows a help popover (iPad only).
Improved support for (external) keyboard shortcuts – Shortcuts now use the Command key instead of Option/Alt, and there’s a new shortcut to clear the console output (Command + K).
Scripts are auto-saved more often.
Fixed: Using an action URL with the
notificationmodule did not work correctly if Pythonista was not already running in the background when the notification was activated.
Fixed: Certain types of syntax errors (e.g. “‘break’ outside loop”) weren’t shown.
Fixed: Exporting the entire script library also exports subfolders now.
Fixed: CJK string encodings should work properly now.
Fixed: After using the
canvasmodule, the console sometimes showed up, even though there was no output.
Python / Modules#
contactsmodule to access the iOS address book database.
locationmodule (access to GPS data and geocoding services)
speechmodule (text-to-speech synthesis).
Most standard library modules have been updated as part of the transition to Python 2.7.5.
sound.play_effect()function now supports local files (in addition to the built-in effects). It also has two new optional parameters for volume and pitch, and it’s possible to stop individual sound effects with the
webbrowser.add_to_reading_list()function to add URLs to Safari’s Reading List.
The standard library is now included as compiled bytecode (.pyc), in addition to the source code. This should improve performance in a lot of cases.
requestsmodule has been updated to the latest version.
There’s a new anti_alias option in the
scene.run()function (the equivalent setting is gone).
Added Modules from the Standard Library#
Other New Modules#
Version 1.3 (2013-02-25)#
Redesigned library view.
It’s now possible to organize your scripts in folders.
Triple-quoted strings are now highlighted correctly in the editor.
Wrapped lines are indented and marked with a triangle symbol in the editor.
Scripts can now continue to run for up to 10 minutes in the background. This is particularly useful for things like local web servers because it’s now possible to access them from Safari. Please note that sound effects will not be played while the app is in the background (but you can use the new
notificationmodule for that).
New sample code: Image Warp and Markdown Conversion
Python / Modules#
notificationmodule allows you to schedule notifications that are shown in Notification Center.
Changes in Existing Modules#
console.write_link()function to create tappable links in the console output area.
scene.unload_image()function that can be used to remove dynamically generated images (loaded via
scene.load_pil_image()) from the cache.
Additional parameters in the
scene.image()function allow to draw partial images (e.g. for things like sliding puzzles).
image_quad()function to draw quadrangular portions of an image. It is also possible to use this to distort images. See the new Image Warp sample script for an example.
It’s now possible to use
httpsURLs in Safari instead of the built-in browser. Simply replace
safari-http://in the URL (
Added Modules from the Standard Library#
pyexpat(this also fixes issues with some other modules, like
Fixed issues in the
scenemodule with auto-rotation on iOS 6.
Version 1.2 (2012-11-07)#
General / UI#
Support for the larger screen of the iPhone 5.
We now have a community forum, come say hello!
There is a new line spacing setting for the editor.
iPad: Some keys on the extended keyboard can be used to enter different characters by touching and holding them. These keys are marked with a gray corner. You can also swipe up on such a key to enter the first alternate key (e.g. swipe up on the forward-slash key to insert a backslash).
You can now run scripts with command-line arguments. Just touch and hold the run button.
Pythonista now has a URL scheme for opening and running scripts that are in your library. See The Pythonista URL Scheme for details.
The prompt history no longer adds the same command multiple times if you repeat it.
Added a new image collection of test images from the USC-SIPI Image Database.
New font option for the editor: Adobe Source Code Pro
The “High Resolution” setting for retina screens is gone (it is now always enabled).
The color picker now has an option to insert HTML-style colors. This is primarily meant for the new
PILmodule, but it has other uses as well.
The gesture recognition on the extended keyboard is a bit less sensitive, so that it doesn’t interpret very small movements as gestures (which could sometimes interfere with tapping keys).
Error markers in the editor now include the type of the exception.
Some additional shortcuts are available to use with external hardware keyboards (see External Keyboards for details)
Python / Modules#
Changes in Existing Modules#
There is a new
console.show_image()function to display images in the text output area. This is used internally by the
Image.show()method in the
PIL(Python Imaging Library) module that was also added in this release.
You can now load images from regular image files with the
scene.load_image_file()function. It’s also possible to load images created with
PIL(Python Imaging Library), using the
You can now get at the underlying image files of built-in images using the
scene.line()function can be used to draw simple lines between two points.
scene.get_screen_scale()function allows you to detect programmatically if your script is running on a device with a retina screen.
webbrowser.open()function has a new, optional modal parameter that blocks the script until the Done button is tapped in the browser. Additionally, there is an optional stop_when_done parameter that can be used to stop a script automatically when the Done button is tapped in the browser.
Added Modules from the Standard Library#
On the iPad you can now view the current documentation page’s table of contents to make navigating in long documents easier.
The documentation now uses DejaVuSansMono instead of Courier for code.
Basic documentation for the
requestsmodule is now included. The module itself was already available in version 1.1, but there was no documentation.
Fixed an issue with big numbers not automatically being converted to long integers (something like
2 ** 100should now work correctly without having to append
__file__variable is now correctly set when you run a script.
Fixed issues with pasted text that contains unicode space characters.
Fixed a bug in
console.password_alert()that caused it to always return
Some images in the Typicons library weren’t centered properly, this has been fixed.
Fixed an issue on iOS 6 that caused the documentation viewer to start with a blank page.
clipboardmodule can handle unicode now.
time.strptime()works correctly now.
editor.make_new_file()no longer appends a numeric suffix when it’s not needed (i.e. when no file with the given name exists).
Fixed a crash that occurred when canceling the console’s “Copy Text Output” dialog.
Version 1.1 (2012-09-11)#
General / UI#
Pythonista is now a universal app that runs on all iOS devices!
The editor has a new search feature.
The editor itself is now scriptable (via the new
editormodule) and custom scripts can be added to the new actions menu for quick access.
Scripts can now be exported from the editor, optionally as Xcode projects that build standalone iOS apps (please note that in order to run standalone apps on an actual device you need to be a paying member of Apple’s iOS developer program).
The script library has a new list mode (in the iPhone version, the thumbnail view is not present and this is the only view mode).
The script library can be sorted by date instead of by name.
The top toolbar that was shown for scenes created with the
scenemodule is gone, so that there is more room for drawing. Instead, there is only a small overlay button in the top-right corner to close a scene.
Python / Modules#
Scenes can now optionally auto-rotate to different device orientations (see
scene.Scene.should_rotate()for more information).
consolemodule provides some new functions:
console.secure_input()– A drop-in replacement for the built-in raw_input that is suitable for entering passwords (the text being entered is hidden).
console.alert()– Allows you to show simple message boxes with up to three custom buttons, e.g. to ask the user for confirmation without requiring keyboard input.
There are several other alert types that allow you to present alerts with text and/or password fields.
keychainmodule provides simple functions for securely storing passwords.
editormodule allows you to script Pythonista’s text editor itself, have a look at its documentation for some interesting examples.
The Documents directory (where scripts are stored) is now the default directory in the interactive prompt, so that it’s easier to write files without giving an absolute path.
The console output and text drawing functions in the
scenemodule support unicode now.
webbrowsernow opens web pages in an in-app browser view instead of Safari.
canvasmodule has new functions for drawing text.
All code samples now have “Copy” and “Open in Editor” buttons attached to them for quickly trying out things you read about.
There is a new “Using Pythonista” page that provides an illustrated overview of the UI.
Text in the documentation is now hyphenated for better readability, especially on the iPhone.
canvasdocumentation contains more details and examples.
The search suggestions in the documentation now show modules first.
The chapter “Using the Python Interpreter” in the Python language tutorial is no longer included. Most of it only applies to other platforms and it seems to have caused some confusion. If you’re interested in this chapter, you can read it here. The same applies to “Interactive Input Editing and History Substitution” which can be found here.
A crash that could occur when holding down the backspace key has been fixed.
Switching from the quick help popover to the full documentation should be more reliable.
os.getcwd()should now work correctly.
Entering a blank line when using
raw_inputno longer raises an
Drawing images with the
canvasmodule now works correctly if no other drawing functions were used before.
Version 1.0 (2012-07-11)#
This is the initial release of Pythonista on the App Store.