What’s New in Pythonista

This page contains detailed information about changes in new versions of the Pythonista app.

Version 1.4

General

  • 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. Pythonista can also open files from other apps, and it’s possible to run a custom script when an external file is opened (see the new “‘Open in’ Menu...” setting). The custom script is run with the file’s path and the sender app as command-line parameters.
  • 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).
  • Scripts are auto-saved more often.

Bug Fixes

  • Fixed: Using an action URL with the notification module 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 canvas module, the console sometimes showed up, even though there was no output.

Python / Modules

  • New contacts module to access the iOS address book database.
  • New location module (access to GPS data and geocoding services)
  • New speech module (text-to-speech synthesis).
  • Most standard library modules have been updated as part of the transition to Python 2.7.5.
  • The console module has a new console.quicklook() function for previewing many types of files (e.g. PDF and Office documents, but also images and media files).
  • The 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 sound.stop_effect() function.
  • New 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.
  • The requests module has been updated to the latest version.
  • There’s a new anti_alias option in the scene.run() function (the equivalent setting is gone).

Other New Modules

Version 1.3

General

  • 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 notification module for that).
  • New sample code: Image Warp and Markdown Conversion

Python / Modules

New Modules

  • The new photos module allows you to access images in your camera roll and manipulate them using the PIL (Python Imaging Library) module.
  • The new notification module allows you to schedule notifications that are shown in Notification Center.
  • markdown2 provides an alternative to the markdown module that was added in 1.2.
  • paramiko

Changes in Existing Modules

  • console module:

  • scene module:

    • New 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).
    • New 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.
  • webbrowser module:

    • It’s now possible to use webbrowser.open() to open http or https URLs in Safari instead of the built-in browser. Simply replace http:// with safari-http:// in the URL (safari-https:// for https URLs).

Added Modules from the Standard Library

  • Added pyexpat (this also fixes issues with some other modules, like plistlib)
  • Added xmlrpclib

Bug Fixes

  • Fixed issues in the scene module with auto-rotation on iOS 6.

Version 1.2

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 PIL module, 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 Using External Keyboards for details)

Python / Modules

New Modules

  • bs4 (BeautifulSoup 4)
  • dropbox
  • feedparser
  • markdown
  • PIL (Python Imaging Library) – Have a look at the new “Image Effects” sample code to see how PIL is integrated with Pythonista.

Changes in Existing Modules

  • console module
    • 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.
    • There are two new functions for controlling the network activity indicator (“spinner”) in the status bar – console.show_activity() and console.hide_activity().
  • scene module
    • 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 scene.load_pil_image() function.
    • You can now get at the underlying image files of built-in images using the scene.get_image_path() function.
    • The new scene.line() function can be used to draw simple lines between two points.
    • The new scene.get_screen_scale() function allows you to detect programmatically if your script is running on a device with a retina screen.
  • webbrowser module
    • The 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

Documentation

  • 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 requests module is now included. The module itself was already available in version 1.1, but there was no documentation.

Bug Fixes

  • Fixed an issue with big numbers not automatically being converted to long integers (something like 2 ** 100 should now work correctly without having to append L explicitly).
  • The __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 None.
  • 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.
  • The clipboard module 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

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 editor module) 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 scene module 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.
  • The Typicons set of monochrome icons is now available to use in the scene and canvas modules.

Python / Modules

  • The scene.Scene class has additional callbacks for when the home button is pressed (scene.Scene.pause()) or the app resumes from the background (scene.Scene.resume()).

  • Scenes can now optionally auto-rotate to different device orientations (see scene.Scene.should_rotate() for more information).

  • The console module 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.
  • The new keychain module provides simple functions for securely storing passwords.

  • The new editor module allows you to script Pythonista’s text editor itself, have a look at its documentation for some interesting examples.

  • More modules from the Standard Library are included:
  • 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 scene module support unicode now.

  • The webbrowser now opens web pages in an in-app browser view instead of Safari.

  • The canvas module has new functions for drawing text.

Documentation

  • 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.
  • The canvas documentation 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.

Bug Fixes

  • 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_input no longer raises an EOFError.
  • Drawing images with the canvas module now works correctly if no other drawing functions were used before.

Version 1.0

This is the initial release of Pythonista on the App Store.