Forum Archive

Wish list for next release

Webmaster4o

First of all, great job with 2.0, it's a great update, and everything I expected.

I don't know if you're planning to work on an editorial update next or pythonista, or maybe something else, but I thought I'd start a thread where people can post their thoughts about what should go into the next update.

I think for the next update, it would be helpful to just provide more modules for use. This would be a good contrast to 2.0, which updates the editor in a lot of ways. The top 5 modules I'd like to see the most are:

  1. Scipy
  2. OpenCV
  3. The photos module but for videos
  4. scikit-image
  5. sickit-learn

I think this alone would be a significant update to pythonista, adding a lot of functionality.

I'm curious to hear what other people want to see most from the next update.

ihf

Pandas would be very useful.

ccc

Python 3.5

Edit: Fixed in Pythonista3 version 3.0 (300001) (currently in beta).

ShunS

I love the way the additional keyboard has changed in the new Pythonista. Everything is in one place. I can type really fast!
Furthermore, I wish the escape \ key (backslash) also be included in the list. The ability to add \ by long pressing + or ' would be fantastic.

Olaf

@ShunS, backslash \ is available by swipe-up from slash / on the extended keyboard

ShunS

@Olaf Thank you for your reply :) Unfortunately, I still cannot see backslash \ from long pressing + > /. I'm using iPhone 5. Maybe it depends on the screen size?

ccc

Try swipe up instead of long press.

ShunS

@ccc I still cannot do it...
I do the following, but nothing happens.
[Tap +] > [/ is displayed, along with % and etc.] > [swipe up on /]

Phuket2

One of the things I would like to see in the next release is an extended font concept. Not just name and size (tuple). But other font attrs such as color and other attributes a family has to offer. But it's quite a change as this would be a font object, not just a tuple. It's a small thing, but will be part of the evolution of the ui module

Webmaster4o

@ShunS This only works on an iPad keyboard, where the slash has its own button. I'm looking on my iPhone 5 right now, it doesn't work.

ShunS

@Webmaster4o Thank you very much! Now everything is clear. That's it for my request. Can't wait to see other wishlist entries :)

marcus67

Release 2.0 is wonderful! Thanks a lot! I'm really enjoying the tabbed editing since I usually work with several files at once.

If it were Christmas again I would wish for:

  • support for arbitrary file names including names without extension and dot files
  • better support for external keyboards (I usually work with a Bluetooth keyboard), e.g. paging up/down through the code, switching between tabs, opening files, etc.
  • support of the action button on the iPhone (or is there after all I ust could not find it?).
Webmaster4o

@marcus67 the action button on iPhone is with the rename and find buttons, tap the file name ;)

marcus67

@Webmaster4o Thanks! I knew it must be somewhere! :-)

disorientedp

A Today widget would be excellent.

dgelessus

@disorientedp Ole has tried that already, but he said that because of the RAM limitations imposed on today widgets you wouldn't be able to do anything useful with it.

Phuket2

@dgelessus , even if we can write out own widgets, would be nice to have one written in objective c by omz. Could provide some forum updates, url launching etc... Just a idea. Oh, other info it could provide is the size of the home dir and I am sure some other useful information

damian

-pip support (StaSh is great, but native support would be huge)
-barring the ability to install packages with C-extension dependencies--
+1 scikit-learn
+1 scipy
+1 pandas

Webmaster4o

@damian native pip support would never get through apple review. It's downloading external code.

gregr

I'd love to see the ability to restrict keychain access with a passcode or Touch ID.

smath

With the unfortunate demise of computable, an iPython notebook with pandas would be awesome.

Webmaster4o

@smath @omz it'd be great if the developer of computable could share port of pandas and scipy for iOS, now that he's no longer competing.

Olaf

For an update 2.1, I would very much like the ability to assign (unused) keyboard shortcuts (e.g. command+Q on an external keyboard) to script shortcuts (under the wrench, as one of the options for edit shortcut, similar to icon).
That way, you could make the editor fit your own taste :-)

ccc

I am not sure it @computable still monitors this forum https://forum.omz-software.com/topic/888/more-python-for-ipad-on-the-way/5

Webmaster4o

@ccc I sent him an email also. I'm assuming he does not, because that's his only post.

@Olaf that's an awesome suggestion, great idea.

JonB

@Olaf I don't have a keyboard to test with, but this should be possible in objc by setting the keyCommands on the SharedApplication, or perhaps the specific view controllers. Maybe someone with an ext kb and some objc knowledge can pipe in.

Webmaster4o

@JonB I have a bluetooth keyboard handy. This would, however be good for a built-in feature. I don't think saying "You can do it with objc_util" should become a replacement for actually implementing it in the app.

JonB

Try running this, which adds a command-h shortcut, which simply prints hi to the console.

(if there is already a command-h shortcut, just change the 'h' on line 27 to some other unused character)

This is not very clean, and might not survive globals clears, and should not be run multiple times, but is more of a proof of concept. If it works, it would be easy to extend to something cleaner (ps this shows an example of swizzling, though in a not very safe manner)

Olaf

Thanks, @JonB, but it doesn't work. I got an AttributeError on line 20:
No method found for selector "initWithInput:modifierFlags:action:"

ywangd

@Olaf
Replace UIKeyCommand.alloc().initWithInput_modifierFlags_action_ with UIKeyCommand.keyCommandWithInput_modifierFlags_action_ and the script will run.

@JonB The script runs after above modification. But it seems to have no effect. Any ideas? It would be super awesome to get this script working.

JonB

Ok, I see the issue... we need to use class_addMethod to add a method to the UIApplication, then the action would be a selector. Apparantly I didn't actually read the docs! I think I can have a fix a little latrr tonight

JonB

sorry to hijack the wishlist thread... custom keyCommands discussion is now here
https://forum.omz-software.com/topic/2609/custom-keyboard-shortcuts

Oscar

A unary minus for the Vector2 class would have been nice:

>>> import scene
>>> v = scene.Vector2(1, 2)
>>> v * -1
Vector2(-1.00, -2.00)
>>> -v
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: bad operand type for unary -

And the next beta build linked against the GameController network. We can test if it solves the problem by using the objc module.

brumm

TableView with more than a single column

ExParrot

PLEASE bring back the Export Canvas to Photos button (from the console); can't even find a function to copy canvas to clipboard so I can use a startup script with code like photos.save_image(clipboard.get_image()).
Argh. Now I regret updating.(Only me?)

Olaf

Additional to @Oscar's unary minus, it would be nice if scene.Vector2 supported:
* unary plus
* from __future__ import division (now breaks division by scalar)
* initiation from another vector (and more generally any sequence of length 2) for generic code
* polar coordinates (like cmath)
* rotation

In 1.5 you could tweak this, but no longer in 2.0 as it's a built-in now

Webmaster4o

@ExParrot yes, only you. I find that most canvas stuff can be done with ui.Path and then exported as an image using the appropriate ui functions.

iBayern

+1 scipy
+1 scikit-learn
+1 pandas
+1 scikit-image

disorientedp

Interactive notifications with the notifications module (for those that don't know what I'm talking about, swipe down on the notification next time you get a text from the Messages app.

Phuket2

Not a big issue. But would be nice have the console.set_color method updated or another method added to handle the console colors with more grace.

Maybe I missed something as usual, but after getting a json object from the web with css color names and hex values, I did this

        conv = ui.parse_color(v)
        console.set_color(conv[0], conv[1], conv[2])

Maybe I missed something. But went looking for this as it appears that faker is also not up to date. Faker has a fake.color method in the latest version. The Pythonista version does not have it.

But anyway, would be nice to see console colors supported with single calls instead of what I did above. If it is already, sorry. I did read the docs and try. (Admittedly, I rarely use console colors, just for debugging)

Edit: v in script is a hex string

marcus67

After working a bit with the UI editor I would suggest adding these features:
* Provide a view type which can serve as placeholder for a subview which is defined in another pyui file. This way you could easily re-use subviews.
* Allow several items in a view to be simultaneously selected, cut and inserted into another view. This would make refactoring view a LOT easier.
* Provide the icon for the action menu while the UI editor is active. Otherwise I always have to switch to a tab with a Python script before I can start my app using an action icon.

omz

Allow several items in a view to be simultaneously selected, cut and inserted into another view. This would make refactoring view a LOT easier.

This is already possible. Tap and hold on an empty part of the canvas, then you can drag a selection rectangle to select multiple views. Tap again on the selection to copy them. Then tap and hold on an empty part of the canvas (possibly in another file) and select Paste from the menu.

RyanM

In Pythonista's Matlab documentation under Toolkits two mapping libraries are mentioned. Both seem to require Proj4 and Shapely that hooks into the GEOS C++ library. So I can't actually use Cartopy or Basemap toolkits. I'd pay extra for the toolkits to have all of their dependencies met in Pythonista or some kind of add-on. I can see a lot of terrific field and data collection uses with these toolkits.

I would love to be proven wrong if it is actually possible to get these toolkits to work.

marcus67

When opening (and not neccessarily modifying) pyui files the order in which the JSON is written out to file does not seem to be preserved. So, I do get changes in GIT commits that are not real changes:

diff

Would it possible to sort the attributes by name before streaming them to file? Thanks!

mikael

Please add background_color support for ui.ListDataSource cells.

mikael

Not being able to subclass most ui classes has been painful to me. This pain has been mostly absent since I found gestures through objc_utils and proxy ObjectWrappers in ProxyTypes. Please consider including the latter; even if it is a very small library, it would provide a shared base from which to share best practices from.

Phuket2

I think it would be nice if in the menu there was a type of ui.ButtonItemMenu. Simlar API interface as dialogs. A little more open. Also including an action and delegate. Well something like that. Also the popup menu designed for the menu item, could be called independently. A 2 for 1 😬

Tizzy
  • option for line numbers on iPhone 6/6S Plus !!! (or ability to slide them out from either side like in messages.app and it's timestamps)
  • better programmatic audio playback controls
  • on-the-fly text resizing via pinch to zoom

Today View widget:
-would be useful just as a shortcut to launch certain scripts via pythonista://url
(i currently use launch center pro of this purpose and it has a today widget so doesn't really matter)
>along the same lines pythonista quick actions tied to a list of favorite scripts in settings...because why not

-where I would really like the ability to make today view widgets with python is incorporated into the xCode template.
-also template support for quick actions would be cool too. (and probably easy to do?)

+1 interactive notifications.

UPDATE:* I feel stupid, I didn't realize quick action for 3d touch support was already integrated.

ywangd

@omz Is it possible to add mmap module in future release? It is part of Python standard distribution. Is it difficult to port?

dgelessus

@ywangd The main purpose of mmap seems to be communication between processes by sharing a section of memory. If you want a byte buffer, you can use bytearray or io.BytesIO instead.

omz

I'm not sure why mmap isn't included, I think I just forgot it somehow. I've never actually used it, but it should be possible to port.

Webmaster4o

@ywangd mmap is in the latest beta, uploaded moments ago

ttobias

Hi,
I don't know if it has already been mentioned somewhere but it would be nice if the app shows that it's running a script via url "api".
If the app starts up and is not returning from a suspended state it just shows the initial screen and I am not sure if the script is running
The small indicator with the script name would be nice for the first start up

ywangd

Thanks @omz This level of support is just like a dream! :)

disorientedp

Delete key on extended keyboard (deletes this way: --> as opposed to backspace: <--)

mikael

It is simple to get the different UISscrollView/UITextView keyboard dismiss modes with objc_utils:

ObjCInstance(textview).keyboardDismissMode = 2 # 0 - normal, 1 - on scroll, 2 - on scroll interactive

But publishing this as a part of the TextView Python interface would be a very easy way to make this rather convenient functionality available to everyone.

(Special note to @marcus67)

marcus67

@mikael Regarding the keyboard dismiss mode: Do you think this would really help on the iPhone in all the cases? I'm not familiar with these modes but is there really a mode that would hide the keyboard when the cursor is located in a simple text field and the view is not scrollbale?

Tizzy

@ttobias said:

Hi,
I don't know if it has already been mentioned somewhere but it would be nice if the app shows that it's running a script via url "api".
If the app starts up and is not returning from a suspended state it just shows the initial screen and I am not sure if the script is running
The small indicator with the script name would be nice for the first start up

This is a wonderful idea. Also would be cool if when you tried to run a script while the other script is running, instead of just a modal dialog with one continue button if there was a button for "stop other script and run this one"

Or better yet ( I Don't have any idea of the technical feasibility of this) what if you could have multiple scripts running at the same time on entirely different threads with some sort of overhauled UI to make it clear how many and which scripts are running?

mikael

@marcus67, no, unfortunately I think this is just one more thing in our toolbelt, exact approach to be selected based on the individual use case and UI preferences.

Just to collect my thoughts, here's the ways we have for dismissing the keyboard on iPhone, until Apple does something about it:

  • Add a custom UI element like a button in the top bar or a gesture somewhere
  • Auxiliary key above the keyboard
  • Using ScrollView/TextView scroll to dismiss option
mikael

One more thing:

Could we please remove or have an option to silence the various clicking sounds made by the editor auxiliary keyboard keys?

Currently they do not respect the system-wide setting, and are really annoying in a quiet environment.

disorientedp

A "busy" option in console.hud_alert for showing that something is loading. This can be seen on other iOS apps frequently.

omz

@disorientedp You can use console.show_progress() and console.hide_progress() for that.

dgelessus

@disorientedp The function console.show_activity can take a string argument, which makes it display a HUD alert with a spinner and that string message, in addition to the spinner in the status bar. This has been around since at least Pythonista 1.5 but is not documented anywhere as far as I can tell. @omz

omz

@dgelessus is right of course, it's called show_activity(), not show_progress(). I wasn't aware that the optional message parameter is undocumented, but that does indeed seem to be the case. Sorry about that.

disorientedp

@omz thanks.

marcus67

I would throw in module lxmlwhich would give us enhanced XML support including XSLT 1.0 transformations.

MartinPacker

@marcus67 I assume there's no XSLT 2.0 transformer available. (Thin on the ground last time I looked.)

roosterboy

I'll second lxml, since without that module it's rather difficult (or it has been in my admittedly somewhat limited experience) to get python-docx and python-xlsx to work and those would be useful to have in Pythonista.

marcus67

@MartinPacker I haven't found anything. XSLT 2.0 is hard to come by, even outside Python. There's only a small number of implementations.

Phuket2

I am not sure if being able to subclass ui compents is in the wind or will ever be. But I thought of something that may be quite useful, at least in my mind.
The simplest form of my idea is that you could call a ui method that sets a callback function that is called upon creation of any ui component. We could be passed the object type, or worse case check with type.
A little more refined would be able to also set different callbacks for the different types of ui components.

That would offer a lot of flexibility and possibilities. Also, especially when testing would be so easy just to style the objects. I know, you can still just have a make button function anyway. But this just seems so much cleaner.

Not sure the impact this would have on performance or threading issues etc. I assume threading type problems would not be an issue as it would only be called on creation.

JonB

Phuket2. - see mikael's last post here
https://forum.omz-software.com/topic/2513/getting-the-parent-of-a-dynamically-method-as-a-function/15

The ObjectWrapper approach is very elegant, and effectively allows you to subclass unsubclassable objects without much cruft.

Phuket2

@JonB , ok thanks. I have installed it. It's not really apparent to me yet why this is a good idea. I have read the doc. I am a little slow on the uptake.
But in your opinion does my idea make sense or is it full of gotcha's and a bad way to implement the functionality.
The little I can get right now, ProxyTypes will help with the subclassing but the thing I like about what I said is that you can centralise a lot of code for styling/adding dynamic attrs etc. Also when sharing here, is all built in.
I assume that if ProxyTypes is compelling , that @omz could include that.
I assume if that callback function was available, could even further help ProxyTypes, hmmm I think....
Ok. But thanks. I will try somethings I was struggling with before when trying the make wrappers around the ui objects

jbap

Uh... Speech recognition. Duh. For like, Siri.

disorientedp

@jbap Will you be more specific? I'm not sure I understand.

Webmaster4o

@disorientedp I think he/she means not dIctating code, but a module for recognizing user speech, which would allow him/her to create something like a basic form of Siri.

pgierz

I'd first like to say that from what I've used so far, this seems like a wonderful app with lots of potential! A few things would really make it shine:

  1. Scipy (with scipy.io, specifically netcdf)
  2. some sort of geographic plotting, e.g. basemap

I also haven't actually checked this, maybe it is already there: but matplotlib stylesheet support would be nice

mason

Not sure if this thread is still being checked, but for me, split screen multitasking is a must. I use and ipad pro and with my screen real estate it's awesome to be able to have half me screen dedicated to the code I'm writing and half dedicated to a webpage or PDF that I'm reading from. I probably won't be using pythonista much until such a feature is implemented and instead will have to use coda to SSH into my home computer instead.

Webmaster4o

@mason Please see:

  • https://forum.omz-software.com/topic/2795/split-view-multitasking-for-ipad
  • https://forum.omz-software.com/topic/2665/ios-multitasking-on-ipad/

Forum search is helpful in this case.

@omz has good reasons not to implement it, but there are a multitude of good workarounds. I do think that this will eventually have to come to Pythonista, but enabling split-screen in iOS as it is right now would mean that locking the rotation would be completely impossible in any part of the app, which is fairly essential to the scene and ui modules.

mason

@Webmaster4o Thanks, that's too bad.

Tizzy

@mason Don't give up hope! WWDC is just around the corner, and perhaps Apple will make some changes/additions to the SDKs that would handle split screen stuff automatically (for example if you're app initiates full screen mode it becomes undocked and goes full screen.)

ccc
import locale
locale.setlocale(locale.LC_ALL, 'fr_FR')
Phuket2

I think it would be great, if v.present('sheet') could have a factor param. And if the factor == 1.0 or more it is full screen on the device.
Long winded example below
It's not so evident why this is good. But often you have the chicken an egg syndrome with 'sheet' and 'full_screen'. For me it's very difficult to handle these cases elegantly. I can do it, just it does not feel right.
Maybe I am dreaming, but I don't think so. So hard to explain. But if no comments then i know I am being stupid again.

```

coding: utf-8

import ui

class AnyCustomClass(ui.View):
def init(self, args , kwargs):
ui.View.init(self,
args, **kwargs)

if name == 'main':
_factor = .50
f = (0,0, ui.get_screen_size()[0] * _factor, ui.get_screen_size()[1] * _factor )
v = ui.View(frame = f, bg_color = 'green')
acc = AnyCustomClass(frame = (f))
v.add_subview(acc)
v.present('sheet')```

dgelessus

I think v.present("sheet") on an iPhone is already the same as v.present("fullscreen"). Though that might be different on iPhone 6+ and such. Or are you writing something that fits in a panel on an iPad Pro, but not on normal iPads? ;)

Phuket2

@dgelessus , I just think the below is convenient. Could be improved upon I am sure. I think the .present() is pretty important in the scheme of things.
I realize the below is not compelling, but would be nice to have more built into ui.View.present() I think

import ui

class SomeCustomClass(ui.View):
    def __init__(self, *args, **kwargs):
        ui.View.__init__(self, *args, **kwargs)

    def show(self, modal = True, factor = 1.0, *args, **kwargs):
        m_bar = 0

        if kwargs.get('hide_title_bar', None):
            if kwargs['hide_title_bar']:
                m_bar = 44

        if factor <= 1.0 and factor > 0:
            f = (0,0, ui.get_screen_size()[0] * factor , (ui.get_screen_size()[1]-m_bar) * factor)
            self.frame = f
        self.present(*args, **kwargs)

        if modal:
            self.wait_modal()

if __name__ == '__main__':
    scc = SomeCustomClass(bg_color = 'white')
    scc.show(modal = True , style = 'sheet', factor = .5)
    print 'fell through...'

alijnclarke

Code import options (may be here already but I haven't found it), Dropbox etc.

Would be amazing if you could put a scp browser or integration with one such as Transmit.

Webmaster4o

@alijnclarke This is unfortunately impossible as it violates one of Apple's policies. Apps are not allowed to download executable code. This means Transmit can download code, since it has no capability to execute it, but Pythonista cannot.

alijnclarke

@Webmaster4o that makes sense, I knew that Apple didn't allow the downloading of code but never thought it would apply in a case such as this (I thought it was worded around silent / background downloading).

Looks like its tonight's project is a Dropbox to pythonista downloader!

Webmaster4o

@alijnclarke That's been done. See Dropbox File Picker by @omz

alijnclarke

Even better @Webmaster4o, may still have a look at making it myself though, just for learning

chibill

Maybe add UIFileSharingEnabled.

omz

I cannot add any ways to import code from external sources. Apple doesn't allow it, and yes, that includes things like iTunes file sharing.

chibill

Really.. Dang Apple. I guess I will just stick with using my file server for upload and download.

Tizzy

@chibill I made a little extension script that can execute Python code inside an apple note or a .py file inside an apple note not very robust but let me know if that's something you're interested in. @omz feel free to delete this if potentially damaging

Phuket2

It's getting late but I will still write.
As far as I can see you can not subclass ui.Rect or ui.scene.Rect. I just Think it would be nice if you could.
Just for the ui part of it, everything is revolving around rects and other primitive's. To use ui.Rect as a base class to extend it would be nice in my opinion. Food for thought.
Ok, today is songkran in thailand. Believe it or not, it's the worlds biggest water fight. Were I live it goes on for 7 days. It's different all around the country.
But more importantly, I would be great to subclass from ui.Rect 😱

@omz, btw ui.Rect, while its imported it's not recognized by the editor.

khilnani

@omz Have to say, this is an amazing application and i want to invest more time into building custom tools and extensions!!

A few requests, much easier said than done, but would be greatly appreciated!!!

a today widget would be amazing:
- to launch scripts - like the share menu (easy access to scripts)
- running and display output of a script on the today screen itself .. like a multiline row cell per script (eg. custom metrics or feed)
- incredible would be display multiple pyui scripts on the today widget.

little things:
- iphone 6/5s line numbers
- custom themes (i saw an unofficial editor, official would be nice)
- speech.is_talking

code modules:
- pandas
- scipy
- scikit-learn
- scikit-image
- seaborn

omz

a today widget would be amazing
to launch scripts - like the share menu (easy access to scripts)

There are launcher apps with today widgets that allow you to launch URLs. You could use one of those with the pythonista:// URL scheme, so I don't really see a need to add that to Pythonista itself (a hypothetical Pythonista widget would do exactly the same as these apps).

running and display output of a script on the today screen itself .. like a multiline row cell per script (eg. custom metrics or feed)

I've experimented a little with that a while ago, but today widgets just don't get enough RAM to be all that useful for scripting.

iphone 6/5s line numbers

Line numbers are already available as an option on iPhone 6 (not on 5s, I find the screen too small for line numbers, I might change my mind though).

speech.is_talking

There is speech.is_speaking() – I just noticed that this is undocumented.

As for the modules, these are all popular requests. SciPy is unfortunately very hard to port, so I can't promise anything there. Pandas is more likely to happen (again, no promises!).

Phuket2

bg_color and background_color. It might be a good time to retire one of these. On the surface it seems ok, but can become a pain when when looking through **kwargs etc to see what is being set
fff 😁

scj643

M2Crypto and more crypto support

Phuket2

A built in script in the wrench menu to print to the screen and copy to the clipboard a forum friendly list of device/Pythonista info. Just see many times when some is trying to help someone here, they need more info, Pythonista Version , device etc...

dgelessus

Speaking of forum-friendly, a way to view and copy a traceback in plain text form. The debugger is nice, but it cuts off long error messages and there's no way to copy the traceback (AFAICT).

Phuket2

ui.parse_color To have an optional param alpha. Seems to me you normally would use this when you want access to the alpha setting when you have a css color name eg. 'teal'. Maybe there is a trick I don't know about, but becomes a multi step process because it's a tuple.
Small thing, but every little bit helps.
I also think that ui.parse_color could be repeated in the documentation in different sections. It's out on a island as far as documentation goes.

Phuket2

Ui.View - a margin property that is of course honoured by the whole ui API. I think this would be a big step forward for ui.Views. I can see could be many implementations of this. In my mind, the bounds would be adjusted to adhere with the margin. In theory at least you would hope that flex could also be applied to the margin. Maybe I am wrong, but I think this could do away with the concept of a container view out of convention is often end named cv.

As soon as views start getting complex, it seems normal practice to create a enclosing view. It's not that it's rocket science, but a lot of extra work involved. If for any uiView you could set a margin and it's margin flex, would be so great.

Personally, in terms of the ui Suite, I would say this would give the biggest bang for the buck so to speak. A lot of lines of code could be saved, over and over

khilnani

running and display output of a script on the today screen itself .. like a multiline row cell per script (eg. custom metrics or feed)

I've experimented a little with that a while ago, but today widgets just don't get enough RAM to be all that useful for scripting.

@omz That would have been nice to have, but am glad you already thought of that.

iphone 6/5s line numbers

Line numbers are already available as an option on iPhone 6 (not on 5s, I find the screen too small for line numbers, I might change my mind though).

Just found - https://forum.omz-software.com/topic/1430/show-lines-number - nice! i assume its coming officially in the beta

speech.is_talking

There is speech.is_speaking() – I just noticed that this is undocumented.

@omz Cool

As for the modules, these are all popular requests. SciPy is unfortunately very hard to port, so I can't promise anything there. Pandas is more likely to happen (again, no promises!).

@omz Thanks for responding, Pandas would be great!!

erikcw

A Picker UI component (i.e. HTML select list).

JonB

@erikcw see https://github.com/jsbain/uicomponents/blob/master/dropdown.py

Niall

I'd love to see an update to the speech module that gives me access to multiple voices by name.
I'm a French teacher and the voices in iOS are actually not bad for listening practice, and to date I've stuck with two voices: the French male one and the Canadian female one. But in theory I've got the two Siri voices available as well, so that should be two men and two women that I could have in a conversation.

I've found a tutorial on switching the voices using Swift (http://www.ikiapps.com/tips/2015/12/30/setting-voice-for-tts-in-ios.html), so I'm going to try and wrap that in myself. But I'm sure I'm not the only one who would be interested (There are 11 different English voices, for instance, which is probably enough for a small game.)

cook

@Niall

Im more than positive you could pull that off with objc_utils module.

AVSpeechUtterence

Tizzy

@omz Improvement suggestion -> iPad UI editor persistent controls panel state across sub views /maybe files

What I mean by the above is that currently the view detail panel to the right of the UI layout area currently does not persist across sub views. For example, If I expand the "Auto-resizing / Flex" panel on one sub view and then switch to another one, it's collapsed again. It's also collapsed again if I switch back to the sub view for which I expanded it. I think it would be useful to have all collapsed/expanded panel states persevere across subviews, and possibly even across pyui files...

Another thing -> in the current 3 beta, the new floating traceback view seems to only sometimes want to list the trace backs... Pythonista 2 seems to have the full traceback for the same scripts. Also, when the correct trace backs are listed, there's no way to jump to the appropriate file on iPad Pro....while the floating view of that file is nice, it would be great if there was also a way to jump to the actual file in full screen editing mode.

JonB

+1 for a debugger.post_mortem(), and also moving along stack should open the appropriate file ( or long tap to open, etc)

craftmojo

Please fix string.maketrans() method. It not working at all. Thanks.

dgelessus

@craftmojo See my response in your other thread, this is not a bug in Pythonista.

craftmojo

Thanks for fast responses. Now, it worked :)

Tizzy

suggestion: adjustable line height for fonts (especially useful for those on smaller devices). Sometimes text size alone isn't enough to optimize for the screen size.

Tizzy

@omz one more suggestion regarding line numbers on different device sizes. What if you had line numbers be an optional toggle on all devices, with sane defaults in place. In fact, I'd love to be able to turn it off temporarily on an iPad Pro. And besides that way maybe you'd be recycling code anyways?

JonB

Yes, it would be nice if all device specific ( as opposed to crrent size specific) settings were togglable, to facilitate cross-app development.

Phuket2

In the ui designer, ability to change the font name of the ui.Table object rows.
Also, would be great if for the CUSTOM ATTRIBUTES panel, if this could be done in a pop up window (ui.View) and better still if that view subclassed the editor so that you had a full editor in the ui.View. Not a ui.TextField which is pretty clunky to type into compared to the editor. Not critical, but I think would be a big enhancement

Tizzy

@omz Suggestion: simple built in sqlite3 viewer. When you go to a SQLite 3 db file in the Pythonista file browser, it would be great if instead of just showing a large icon and open in, it showed the contents. Would be useful as a quick reference while developing...remove friction for just quickly checking a result.

Phuket2

@Tizzy , I am doing some things in sqlite3 at the moment. Not trying to be smart, but seems like a unreasonable request. A SQLite browser is a full app. I use SQLed App to open the Sqlite3 databases. It shows up in the share sheet , when you click the "open in..." button from the file browser page. Maybe I misunderstood your request. I am at the moment trying to make some generic classes to give info of the database as well as the data for a given table. But will be nothing like an app intended for this purpose. Anyway, maybe you had something else in mind. Would like to hear about it as I am still trying to work out what to display. Which tables, Pragms, record counts etc... A lot of info

Phuket2

@Tizzy , hmmm funny, I just shafted myself. Was not connected to my comment, I was just doing this anyway. Both @JonB and @ccc have warned me in the past about using del in classes 😱 I was calling my SQLite wrapper that contains a del in a ui.tableView. Got the below 😂
I always have to learn the hard way.🤐
Just seemed relevant somehow. And it just happened. Sorry I digress.

dgelessus

CREATE TABLE IF NOT EXISTS Junk

That command is 100% guaranteed to be a no-op in my Pythonista. :P

Phuket2

@dgelessus 😱😱😱
Now it's not easy for me. I can get it to work by using the @on_main_thread decorator with my custom class.
I sort of know why, but not really. So I think I can solve the problem but without understanding exactly why it's solved. I have to live and learn 😱😱😱

Niall

@cook
Yes, I know it can be done with the objc_utils, and that's what I'll be using. It just seems like the sort of thing that would be useful in a standard library, and as the speech library already sets up all the listeners etc to queue up multiple lines, it feels slightly like reinventing the wheel to write my own library.

Tizzy

@omz feature suggestion - text resizing in the documentation viewer - especially useful in conjunction with the newish console/docs sidebar-pinning.

Bonus points: keyboard commands to resize (command +, command - ???)

mikashkin

I know that it already asked tens of times, and @omz noticed, and know. But I also want to add that I'm interested in scipy scikit-learn pandas modules.

And thank you for your great work.

JonB

Currently, the rootview controller has three gestures, but no gesture delegate implementing

gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:

When presenting in a panel, this sometimes means gestures are stolen from the view being presented.

This can partly be prevented by implementing one's own delegate for panel views that prevents simultaneous recognization from the rootview recognizers, however sometimes the system sends the gestures first to the rootview. An example is when implementing a pinch/pannable view, that makes use of transforms, and also has the ability to do single finger panning (drawing).

All works fine, until the view is zoomed such that it is larger than the rootview... then suddenly the rootview gets first crack at the gestures, and greedily accepts them to pan back to the editor.

The ideal situation: the root view controller should implement gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:, and check if the other gesture recognizer is from a view inside a tab (if so, fail the rootview's gestures). Well, any approach that allows ui.View's presented in panels to get first crack at touch events (the abive approach is what I plan to swizzle into place, but it just seems very wrong)

This makes it impossible to design reliable ui's intended to live in a panel. the user can always swipe from the title bar...

BillBaroude

Hi there,

I share my point of view here, in my specific context : Dummy in Python starting with Pythonista.
During the last weeks, I started a little game project to get more familiar with Python, and here are the most wanted features I have :

  • Communication between dev. target machine (iPhone, iPad, ...) and a desktop machine (Mac). This will extend drastically the quality of development environment, especially for long script, but also will help to integrate your own graphics, music, in an easy way. This can be :

    • Direct link using a specific app on desk machine to communicate with Pythonista app on target machine.
    • Pythonista "emulator" on desktop machine / specific setup to be able to write and run scriptes directly on the desktop machine and simulating the target one
    • Integration of the DropBox Sync script in the native tools given with Pythonista + an "how to" in documentation.
    • Active version of the DropBox guy, with no run to do to synch (speed up dev process)
  • More and more code samples in the reference documentation. Even if the documentation is really well done, dummies need help and as much examples as possible.

  • iAd module easy to use in Pythonista (apple advertising in apps or equivalent). This will help a lot developers to make money with their Pythonista projects, and then probably bring a lot more projects under this platform.

I admit that's a Christmas list :)
Thanks,

Phuket2

@BillBaroude , this is not an answer directly. Not sure you have seen this repository or not. Has a lot of great Pythonista tools etc...
http://pythonista-tools.github.io/Pythonista-Tools/index.html

@omz, maybe a good idea to expand the sticky post here to say something like Pythonista resources and include the Pythonista Tools Repo as a link also?

JonB

Bill, you will find a number of dropbox sync tools if you search the forums or Pythonista-Tools. Other working solutions right now are stash, which includes a workng git client, as well as scp, ftp, as well as a new command in the dev branch (i forget the name) which lets you "mount" things like dropbox repos. Ole cannot include a full sync capability due to app store rules regarding executable code, so homegrown tools are the best solution.

Phuket2

ui.Path.rounded_rect , I am having difficulty to make a recipe that can deal with the 3 built in shapes (rect/oval/rounded_rect) generically. I mean without a test.
I assume there is a "Python way to do this. But I can't figure it out.
I posted here because, it still seems like there must be a better way to natively handle these Params. Eg, rect and oval get a corner_radius param that basically is a no op. As I said before, I don't look at objc stuff yet. But as I start to put it together in my head, I start to understand that most if not all these API calls are mimicking the objective c calls. Anyway, it would be nice if it could be rationalized some how.
My small example is below. Is only a test case. Maybe I would like to pass the base class instead of a index.

class MyShape(object):
    shapes = [ui.Path.rect, ui.Path.oval, ui.Path.rounded_rect]

    def __init__(self, r = ui.Rect(0, 0, 100, 100),
                                shape_index = 0, *args, **kwargs):
        self.r = r
        self.radius = 6

        shape = self.shapes[shape_index]

        if shape_index == 2:
            # rounded rect
            self.shape = shape(*r, self.radius)
        else:
            self.shape = shape(*r)

    def draw_me(self):
        with ui.GState():
            ui.set_color('yellow')
            self.shape.fill()
Phuket2

This may sound a little stupid. But I would love to see a run button incorporated into the Pythonista part of the keyboard. On a iPad Pro, the run button is quite far away. Also with my bad eyesight I often end up hitting a editor tab or its close button quite often. Not sure you need to have bad eyesight for this to happen.
On the iPad Air 2, this wasn't an issue

Phuket2

Wasn't sure if this Thread was dead or not. But will write here anyway.
@omz, what would be really really and more really cool would to be able to use the drawing functions such as ui.Path etc to draw into Custom Views inside a pyui file. The code/commands could possibly live In dict style construct inside the custom attributes, whist still being able to the custom attribute fields for custom attributes. So the idea is that drawing Cmds would be both executed in the designer as well as runtime.
This would be great for making user controls, like a radio button for example. Of course the custom attributes a huge benefit, already having a built in mechanism to handle state etc.

I am sure a more grandiose implementation could be done. But this in its self would be great.

I know, we can implement all this now all except the rendering inside the Designer. For me, I think this type of extensibility is huge.
My fingers are crossed 😇😇

JonB

I agree it would be nice to show what a custom view looks like in the ui editor, but I don't see how that could work unless the custom view was instantiated as a live object. Most useful draw methods, I think, depend in some way on the instance properties. How would the UI editor know which class to instantiate? (custom view class names are not in scope until runtime).

I guess what you are suggesting is the ability to set some preview draw code or image. For instance maybe you'd copy your draw code, replacing any self.property's with hard coded values, so the preview would show a sort of generic instance, like the way tableview is shown

You would need to add that custom code at the top level pyui, not your custom view....

Perhaps if there was a "CustomView Library", sort of a snippet manager for the UI editor, where you could define commonly used custom views (size, colors, preview, CustomView, custom dict, etc)

Phuket2

@JonB , I am sort of guessing now. I am not 100% sure. But let's say you could put code somewhere, like the Custom Attributes. Some code that looks like a dict or whatever. As an example I put in the pic below.
So let's say the rule is for user drawn controls, locals are not allowed. The code/function defined has no parent. It's just a function. This is where it gets fuzzy for me. I am not sure how you add that text function. Possibly just a exec. Maybe some of the libs like functools. Not sure. But of course the approach needs to be generic so that the ui.View knows how to call it, if it's present. I am sure it can be done. Well pretty sure.
This would be a big break through.

JonB

If you are thinking that this code would be used when actually presenting, I think the utility will end up being very limited. Most cases for a custom class I can think of need to use instance properties to decide what to draw.

Keep in mind, the ui editor does not load pyui's. It lets you type a name of a class which might not currently exist until runtime.

ShunS

[Edit] This was implemented in version 2.1 and on Pythonista 3. Thanks omz team :)

In the Console window, when I copy a long line from the history, and type something at the start of the line, the part I am typing now is hidden in the left part of the input field. Could you update the app so that the place where I am typing (in other words, around the place of the cursor) is always displayed? Thanks.

Phuket2

@omz, I realize this will be not high on the todo list. But would be nice if you extended themes to dialogs.
Eg...

def show_about_dialog():
    dialogs.list_dialog(items = ['one', 'two'], theme_name = 'Cool Glow')
ShunS

@ShunS This was implemented in version 2.1 and on Pythonista 3. Thanks omz team :)

eddo888

would love to see editor code folding
screen realestate on an idevice is precious
folding would help maximize this

ellie_ff1493

same code folding, along with vertex shaders in scene and opencv