Forum Archive

Feature Requests

LAM251

I'm guessing that pure python packages are probably easier to support than ones relying on compiled code. It would be nice if there were some way of supporting user installation of such packages. (If they are a single file, it probably possible now.)

However, for some packages, like numpy and matplotlib that would require significant porting effort, it would probably be difficult to support user installation. Do you think it would be feasible for developer/users who want some of these packages to post binaries or Xcode projects for potential inclusion in future updates?

A final thought: Given that some non-standard packages will take significant effort to port, such effort should be compensated. How about providing them as In-App Purchases? I would gladly pay for a numpy, scipy and matplotlib bundle.

athros216

I also would gladly pay extra for port work.

tahoma5

So far, I want:

  • registration as a Mail export target for .py files;
  • an iPython-based interactive console;
  • pygame.

-- Tahoma

omz

To be honest, I haven't had much luck with porting numpy (matplotlib also relies on that). Parts of it are written in Fortran and it's overall very low-level and hard to port. I'm not saying it's impossible per se, maybe I'm just not smart enough...

Installing pure Python modules is usually relatively easy to do with a script – as an example, here's a quick-and-dirty script that installs the cloudfiles module (for RackSpace): https://gist.github.com/9c54a36c619261067225

I cannot add anything that downloads code to the app itself – that includes things like being able to open .py files. Apple would reject it and they have actually requested (i.e. enforced) removal of similar features in other apps. There's a rule in the App Store review guidelines that forbids downloading/installing executable code and they have a pretty broad definition of "downloading".

LAM251

Have you looked at kivy? http://kivy.org/

It's a cross-platform, open source GUI for python that has been port to iOS.

omz

Certainly looks interesting, the LGPL license could be problematic though.

LAM251

They claim "Kivy is 100% free to use, under LGPL 3 licence. The toolkit is professionally developed, backed and used. You can use it in a product and sell your product."

There are two apps in the App Store using kivy, one is free (http://itunes.apple.com/us/app/deflectouch/id505729681) and one is $75 (http://itunes.apple.com/us/app/processcraft/id526377075).

However, I'd be the last one to ask about what any particular license allows or not.

Another GUI I came across is PyUI (http://pyui.sourceforge.net), which has an option of rendering using PyOpenGL and PIL.

Jtg7850

The one feature I would really like is for my scripts to sync between my iPhone and iPad via iCloud. I think that would make development a lot more convenient as I like to switch between both devices for different types of tasks.

oefe186

You could use the Dropbox code posted here to sync your devices:
http://omz-software.com/pythonista/forums/discussion/10/using-the-dropbox-module#Item_5

You would have to start the sync manually, however.

For my part, I would rather want support for a version control system. The currently available methods to up/download to gist are a start.

pudquick51

@oefe: Unfortunately that kind of feature is the thing that tends to keep code interpreters out of the App Store. As long as the app doesn't directly ship with the ability to both execute interpreted code and load code from an internet-based source, it's generally OK.

I've heard this complaint from many different interpreter makers on the store - exporting to the internet is almost always ok, but being able to pull in code from an arbitrary location with an account / URL is generally a "no-no" feature to have enabled when publishing to the store.

oefe186

Sounds doable. A small part of hg is written in C for performance reasons, but there is apparently a pure Python option. I think we can live withbthe performance hit of the pure python version. After all, we few of us will have Gigabyte sized repositories any time soon.

NoneNone94

Dear all

I was going to post a thread regarding "Feature Requests" in which all of the requested features could be included by members. Just description of them and not any commenting or debate, etc. so that just with a glance one can understand what items are mostly required.

But I am just a newbie and I want to know ur ideas about it. Do you think it is a good idea?

pudquick51

@rhithyn - You can already do that. If you use the modal parameter on the webbrowser class, it can run non-blocking in a different thread - leaving you free to run python code in the background to serve it up.

I've got several bits of code I'm working on right now that run python as the "server-side" code with the browser as the UI. Works great.

omz

@rroobblinn You can tap with two fingers to select a line.

Dalorbi39

Meshes?
Is it possible to get meshes in Pythonista. If we could how long would it take @omz

Sebastian

I don't know if this is difficult or not, but a way to pause and stop a sound.
That would help me because I just started making a simple music player.

DaveR133

I'd like a facility to 'lock' a script. It's easy to accidentally hit a key and introduce an error when all I intended was to run it.

The ability to run the script from the library without going into the code editor would be useful too.

C0deH4cker

PLEASE support multiline strings! I use them as docstrings, but in the current version of Pythonista, the syntax highlighter balks at multiline strings, and the editor will suggest random words from within the string when I'm typing code.

C0deH4cker

Id love to see a way for a script to be run on startup.

pudquick51

@C0deH4cker - See my tool here:

http://omz-software.com/pythonista/forums/discussion/64/create-pythonista-webclips-directly-from-pythonista

This will let you make an icon for running a particular script in Pythonista when you click it.

Admittedly, this is a bit different than your use case - I'm guessing you want to customize your Pythonista environment every time you start it - which if that's the case, I agree, I'd love that feature.

But if all you want to do is have Pythonista always run a particular thing when you open it, try my solution above.

C0deH4cker

Actually, i mean a script that gets run whenever you run a script, such as the site module in normal python.

robbielj31

I second the background running feature.

tahoma5

It would be nice if the editor module could expose the editor settings (at least for read, if not read/write), perhaps presented as a dictionary.

Specifically, at the moment, I'm interested in being able to inspect the 'Tab Width' setting in order to cleanly incorporate a tabify/untabify action script.

Many thanks to you, omz, for building this app and continuing to improve it.

C0deH4cker

@tahoma
I made this Macros.py script that I use for Pythonista. Maybe this will be helpful to you:
https://gist.github.com/3ae7811f06caabba80c9

I have a separate script for each that basically just does:

from Macros import function

function()

Except one of them, Spaces To Tabs, is this:
https://gist.github.com/60088a8513acaa99fd59

So this might be what youre looking for. If not, I'm sure that this will be helpful to someone.

kamek18

I'd love to see kivy on ipad or at least pygame, then pythonista could compete with codea.

pudquick51

@kamek - Unfortunately, because kivy is LGPL, it's very difficult to use it with an iOS app. The way the licensing of LGPL is intended to work, you either need to a.) be able to freely re-link newer/different versions of the LGPL licensed library into your app, or b.) provide the source of your application that uses the library so people can re-compile it themselves.

Obviously, as a private developer, omz is unlikely to be willing to release the source code of Pythonista as it's making him money. This means choice b. is not happening.

As for choice a., iOS apps submitted to the App Store are static applications compiled as a single monolithic executable. There is no ability for a third-party to 're-link' a newer/different version of kivy into such an application without the original .o object files and/or .a static library files (which omz would have to provide - and is again very unlikely).

The only app that I've seen on the iOS App Store claimed to use kivy is ProcessCraft. The other one mentioned (Defletouch) seems to have been removed. And if ProcessCraft is using kivy, they are 100% in violation because they don't provide the source / comply with kivy's LGPL license.

As for pygame, that's a really complex library built on several other technologies that would be pretty hard for a single person to port over/adapt to iOS.

webvex34

My wish list:

  • Allow scripts to run in the background, even for a limited time

  • iCloud file sync (I get the Dropbox problem, but iCloud should limit it to just between Pythonista installs on multiple devices) versioning would be nice, but that can be worked around

  • Settings option for spaces instead of tabs for indents (this has been driving me crazy with errors in the editor and with Gist posts) and/or a Settings option to show whitespace characters in the editor

omz

Scripts will be able to run in the background for up to 10 minutes with the next update. Yes, it is kind of fascinating to open a localhost URL in Mobile Safari ;). This will also enable some other pretty interesting use cases, e.g. scripts that watch the clipboard while you're working in a different app...

As for iCloud sync, I'm pretty sure this wouldn't be approved by Apple; they don't even allow iTunes file sharing for executable code...

webvex34

Thanks for the update! That will be great to have scripts run in the background, and I understand the file syncing issue. Maybe Apple will relax eventually.

Is there any hope with the spaces vs tabs? I'm still learning Python, but from what I gather, spaces vs tabs is a bit of a hot topic. PEP 8 strongly recommends spaces only for indents in new projects, though there are arguments from both sides. Options would be nice.

omz

I know that tabs-vs-spaces is an issue, especially with pasted code etc. I'm aware of PEP8 but still personally prefer tabs (but I don't want to start a debate here)...

Eventually, there will probably be some sort of setting for this, though I'm not sure about some implementation details yet (e.g. what to do when a file is opened that uses a different tab setting...). I would also have to make some changes to the text rendering (making tabs visible when spaces are selected) so it's really not a trivial feature... To sum it up, this probably won't be in the next update, but it's definitely on my radar and that update won't be the last one. ;)

webvex34

Thanks again. In the meantime, we can write conversion scripts and, BTW, I will be posting a new project soon that does just that sort of thing.

mcsquaredjr148

Thanks for the app, it rocks! I have a small request. It would be nice if multi-line docstrings were properly highlighted in the editor :)

zaphodb227

Folders! It would be great to be able to organize all the python scripts in multiple folders. Having all the python scripts cluttered in one big list makes it very unwieldy to work with large, multiple modules.

Also tabbed pane viewing to easily switch between modules.

btw. The app does rock. Great job, thanks.

C0deH4cker

@omz: I know there is somehow a 10 minute limit in the os, and 10 minutes is fine, but some apps (ie pandora) can run presumably forever in the background. Do you know how it does that?

omz

@C0deH4cker It's because they are playing music, there's an exception for that.

theseus217

hi,

i would really appreciate numpy or scipy? would be worth some bucks :)

C0deH4cker

@omz Then add the ability for scripts to play music like that. Then, people could play silence and have it running forever lol.

pudquick51

@C0deH4cker - Unless the primary purpose of your app is music playback, Apple is extremely displeased if you attempt this kind of 'loophole'.

The same goes for the other flags that allow permanent backgrounding: GPS, VoIP, etc.

Good way to get your app immediately yanked / over-analyzed by Apple for any other slight infraction they might not have noticed before.

smkirby229

Extraordinary app... Thank you so much for making it! I have some really minor wishes (along with a more major one). I use pythonista mostly at the interactive prompt, and would love an option for the app to open there directly, rather than having to wait for it to load and then swipe across. Also, could you implement a menu for reloading a script as a module into the interpreter (or alternatively executing them)?

The more major one is numpy/scipy/matplotlib. I understand this is probably too big a task though! I wonder if a port of some of matplotlib's basic functionality would be possible using the canvas stuff?

eliskan175

Yeah I would like to see matplotlib included into Pythonista in the future. I've used it plenty in the past and it was very nifty.

Access to more of the iPad/iPhone's camera, mic, GPS services, etc would also be nice.

Finally I would LOVE to see a free Pythonista app that lets people run codes that are submitted onto a server from -paid- app subscribers. So if I bought the app, I could upload my projects and someone who has the free app could then view the app in their free version. I'm not sure this is possible due to Apple's store limitations. But something along these lines would be great.

Keep up the good work! I can't wait for my Logitech keyboard so I can really utilize this app to it's potential (that touch screen kills)

Sebastian

I was wondering if it will be possible to access the iPod library (like play music, retrieve song info, and detect if music is playing).

The reason why I want this is because I've already created a script on my Mac which prints out the lyrics to the song iTunes is currently playing, and I would like to be able to do the same on my iPad.

FLA5H197

Pygame or something would be awesome! Iv been using pygame for a while but right now i cant always be near my computer so it would be nice to have something similar instead of having to completely learn a new library ( like I'm attempting to do now with pythonista)

mspriggs172

Could you add support for position, accelerometer, magnetometer data along with access to the apple map api?

It would also be great if you could add support for OpenGL ES

Pythonista is the tool that has finally got me into writing Python after years of Perl scripting. It's great to finally have a tool that means I can write useful code directly on my iPad. Thanks

mspriggs172

When using an external keyboard within the Python interactive prompt it would be useful if the up arrow key on the keyboard would go back through the command history

eliskan175

Speaking of using keyboards on Pythonista.. A big annoyance for me is typing '''

If you try to type it, you will get ''''''

And if you delete one of the apostrophes, you'll delete two.

The only way to type ''' is to type ' ' which produces '' '' then you add a space to the second one, so you end up with '' ' ' ... then you delete one of the two seperated apostrophes, THEN combine them. Finally you get '''

It really is a pain in the butt for something that I use ALL the time to comment out blocks of code.

I would like to suggest a way to tweak the auto complete features. I understand the usefulness for them when you're typing by hand, but if you invest in a keyboard they really become a problem!

DaveR133

+1 for kivy - x-platform GUI

http://kivy.org/

I wrote a python program for Android using it - with the advantage that I could test it on Linux first. Only the paths differ between the two OSes.

Currently I maintain two versions of my Pythonista programs - the Linux ones use tkinter and the iOS ones use console - which is a bit clunky.

jose3f23

Definitely Scene needs keyboard events support for input.

T0m101

Hey, I'd like to put in a request for gevent & greenlet; they are really the only modules I find missing in Pythonista. I've manage to cobble up a a script to install any pure-python modules I'd require from zip files or gzip files.

While the iPad is not designed to be a web server but it would be great to be able to test my web server code on the iPad itself, would help a huge community of python web developers escape their desks :)

DaveR133

After my post about kivy I saw pudquick's post about licensing earlier in this thread:
http://omz-software.com/pythonista/forums/discussion/comment/402#Comment_402

I also looked at what kivy (who also produce the python-for-android environment which I used) said about it:

Kivy is released under the terms of the GNU LGPL Version 3. ... An online version of the license can be found at http://www.gnu.org/licenses/lgpl-3.0.txt In a nutshell the license allows you to use Kivy in your own projects, regardless of whether they are open source, closed source, commercial or free. The one thing the license does enforce is that if you make changes to the Kivy sourcecode itself, you have to share those changes with us. For a more thorough legal explanation ....

(From http://kivy.org/docs/) Which is not quite the same emphasis - but the licence itself is pretty clear and confirms pudquick's post.

Much seems to depend on static vs dynamic linking - about which I know little. This seems to be summed up here:
http://stackoverflow.com/questions/10130143/gpl-lgpl-and-static-linking

Proprietary Source code + LGPL Source code - statically linked: You must release both parts as LGPL. - dynamically linked: LGPL code stays LGPL, you can keep the proprietary code proprietary.

(Do iOS apps differ from an Android ones in that respect?)

Could a scripting app, like Pythonista, provide a version of the kivy libraries without itself linking to them? Arguably the scripting app would then not be an 'Application' under the definition in the LGPL. That would put the onus on whoever writes a script using kivy: if that were 'conveyed' they would be subject to the LGPL.

Kivy's python-for-Android may be a special case - they own kivy. But I see that Qpython for Android provides a kivy library and promotes building apps. (I suggest we don't discuss it's licensing here though.)

jose3f23

Would it be possible to install self compiled (i.e. _amodule.so) modules in the Pythonista.app folder and then call them ?

I mean modules compiled in C or ObjectiveC and wrapped to Python with any of the tools available, Swig, Cython, PyRex, F2Py etc.

yodayoda230

Agree with eliskan on the double-quote issue.

oefe186

Apple's rules require that the library is statically linked, so LGPL code is off limits for Pythonista.

meu135

The app is fricken awesome, but i do have one request: Could you make the '\r' carriage return character work in the console?

pudquick51

@DaveR - The inability to use dynamically linked code in the iOS App Store is a technological limitation, with legal limitations (in regard to the LGPL) only as a side effect.

The way the App Store DRM works, your copy of any particular app, sold/assigned to your AppleID, has a chunk of the executable encrypted in a method related to your AppleID.

If you attempted to modify an App Store app's executable (somehow) after it was downloaded and installed on your non-jailbroken device, the signature of the app would change and decryption would fail - resulting in the modified app refusing to run. As a result, this cryptographic signing serves as a guarantee of sorts that says: "This app, as it was written when submitted to us, has been approved as SAFE". Tampering with the app invalidates the signature and denies execution.

Since a dynamically linked library makes it very trivial to have parts of your app that you can "swap out" with updated/alternate versions (a main requirement of the LGPL), it just turns into an even larger security headache for Apple's choice of DRM. Either they have to sign every little dynamic library in your app as well - or they can go the route they did and ban it altogether.

You cannot create dynamically linked iOS apps without patching the linker. If you do make one and submit it to Apple, it will be denied for publication on the App Store. In addition, any attempt to trigger a dynamic library load for anything other than iOS-provided system libraries will cause your app to immediately self-terminate.

omz can't do any .so / .dylib loading for you, folks - PERIOD. And yes, I mean ctypes and all the rest. So stop asking!

The Android ecosystem is a different beast entirely. Since the UI application layer is Dalvik (basically a Java VM), an app doesn't get any hardcore speed unless it links in native code libraries via NDK. Since Dalvik/Java bytecode and native ARM code are two separate beasts, by their very nature they're in separate pieces of the application (wrapped up in an apk bundle, but still separate files inside).

http://developer.android.com/tools/sdk/ndk/index.html

So instead of banning it, they embraced it and did their DRM / licensing in a different fashion. As a result, linked libraries DO exist in the Android realm.

As I don't do Android dev for a living, I can't tell you if "let users load their own .so files" -style applications exist, however.

TL;DR: Please stop bugging omz about including third-party modules, unless they have very small native code components and are liberally (MIT, etc.) licensed. He just can't do it, folks.

DaveR133

@pudquick Thanks for that very full explanation. I'm not a developer these days, but as a Linux user I find these restrictions incredibly frustrating - though I understand the commercial and technical reasons for them. Thanks for your patience.

Lluang187

Two requests, both are pure python modules

Sympy. Symbolic math. And it gets much of the functionality I would normally get from Scipy, even if it is much slower.

Simpy Simulation library. I use this a lot and this would turn my ipad into a serious modeling tool.

jose3f23

@Lluang: SymPy is yet functional in Pythonista. Search for SymPy in Forum.

By the way, one of the last posts by @omz is how to compile SymPy to speed import the module.

http://omz-software.com/pythonista/forums/discussion/262/import-takes-way-too-long#Item_4

Gerzer

@wbwelcomeback If you have a Mac, you can download Xcode and export your Pythonista script. If you want to continue working on your project in Xcode, set include images to all. The only problem is that it's hard to transfer back to Pythonista. If you want to test the Xcode project on a real device (not the simulator), however, you need to sign up for the iOS development program.

ccc

omz wrote> As for iCloud sync, I'm pretty sure this wouldn't be approved by Apple; they don't even allow iTunes file sharing for executable code...

This week's update of CBM Hand BASIC added a feature that allows users to bidirectionally sync .bas files via the standard iTunes sync. See: http://cbmhandbasic.blogspot.ch Apple might have let this through because very few folks want to hack Basic these daze. But perhaps Apple is loosening the reigns a bit on their app review process.

omz

@ccc Interesting, could be that it just "slipped through" though. Btw, you can easily do the same with Pythonista by using an app like DiskAid or PhoneView.

LAM251

OpenCV (Open Source Computer Vision) has an iOS version. OpenCV also has Python bindings. This would not only provide image and video processing, but the core module provides some basic array and matrix operations that could be useful elsewhere. Just a thought...

achorrath233

I'd like to be able to add my own code templates. I imagine it extending the list of options you see when you press + to create a new file (Scene with Layers, Basic Scene, Empty) much like you can extend the Actions menu.

[deleted]

Custom modules anyone?

ccc

Creating your own modules "just works" in Pythonista. Or were you looking for something else??

To see a module in action, check out: bashedcrab's Hydrogen GUI Framework for Pythonista...
Hydrogen.py is a module -- running it does nothing
HydrogenDemo.py is a script/app/program -- running it imports Hydrogen to create a GUI that the user can play with.

http://omz-forums.appspot.com/pythonista/post/5003825878401024

[deleted]

Now, how am I suppost to add this to the python library, or using another method, to be able to import this example module?

ccc

The first line of code in HydrogenDemo.py is:

from Hydrogen import *

Which imports all the code of Hydrogen.py into HydrogenDemo.py.

tomasorti110

I support mspriggs opinion to have OpenGL support...
Although I think it can be real challenge, since it seems the ES bindings may not be very mature.

http://raspberrypi.stackexchange.com/questions/4852/how-to-use-opengl-es-through-python

https://github.com/peterderivaz/pyopengles

http://pyopengl.sourceforge.net/

IMHO, I think this might boost Pythonista popularity, even more.

jysue162

I propose adding playing several sequential sounds (like piano notes) as an "animation". If you play several notes in a row doing:

notes = 'C3', 'D3', 'E3', 'C3'
for note in notes:
sound.play_effect('Piano_' + note)
time.sleep(0.5)

even though sound.play_effect is asynchronous and returns immediately, because the notes are played in a for loop, draw doesn't get called until the sounds are all done. The "to_value" in animate would be a sequence of sounds (not just piano notes). In draw (or perhaps "play"), you would do the same "layer.update(dt)" and "layer.draw" (or "layer.play").

This could be implemented using only Python (make a queue of sounds to play, check if a sound is done, and if so, play the next one), but having this as a built-in "animation" would be nice.

Another nice thing would be being able to add your own sounds to the sound library.

bashedcrab

Hi Ole,
I'd appreciate the option for partial screen rendering in the scene module. So I can start with the previous frame buffer, and only update/change the areas I need rather than having to redraw the entire scene.

I've started on a branch for Hydrogen that implements a "dirty-region" algorithm to only redraw the areas of screen that need it. However I end up with a black screen and only the newly redrawn areas indicating I'm getting a completely new framebuffer, and I can't see a way to preserve the previously drawn scene.

dsaravel

Hi there

Pyhtonista is great! I love it!

The only 2 things that are not working, even though they have been mentioned before, are:

  • tab size in iOS7 not working at all
  • auto complete for single and double quotes for when you have an external keyboard. It just doesn't work properly.

Thanks

ccc

UPDATE: The tabs issue was fixed quite elegantly with the soft tabs feature of Pythonista v1.4.

Instead of tabs, you could use 4 spaces. Python PEP 8 states that spaces are Python's preferred indentation method instead of tabs. Bulk conversion tabs to 4 spaces is a simple process in Pythonista.

omz

@ccc @dsaravel The tab size issue on iOS 7 will be resolved with the next update. It'll also bring an option to indent with spaces instead of tabs btw.

ccc

I have just been playing with the new Pages app from Apple... Me and my brother were editing the same document and instantly seeing each other's changes dispite being thousands of miles apart. It would be a cool feature for Pythonista to allow two coders to jointly edit a single script -- seeing each other's changes in real time. It would be a great way to pair up an experienced developer with a neophyte. Also cool for code reviews.

ccc

Python v2.7.6 has now been released: http://www.python.org/download/releases/2.7.6

Hopefully it will form the core of the next release of Pythonista.

Johncohn

Id love a way to use bluetooth low power from pythonista. It would be a great way to do internet of things !
-jc

KainokiKaede

I would like to vote +1 to the feature mentioned by @Sebastian.

I want to create "Now Playing" string, but currently there is no way to obtain the music title from Pythonista. It would be pretty nice to have the feature.