• Niall

    Ooooh... neat.

    I don't think I'll bother trying to implement the connection management at this stage -- it'll be a very early-stage prototype, and only I'll be using it, so I can do that manually.

    Many thanks!

    posted in Pythonista read more
  • Niall

    Apple is very precious about background services, and there was a point a few years ago where they cracked down heavily on app developers using background processing for convenience rather than strict need.

    In order to get through app approval, you have to have a very strong case for allowing background operation, and I'd be very surprised if Pythonista would have got through approval with an open API for background tasks that would basically allow anyone to do anything they feel like...

    posted in Pythonista read more
  • Niall

    I'm pretty certain the answer is "no" (because otherwise I'd have found something when I tried searching the documentation) but is it possible to get Pythonista to send a different picture to a connected HDMI or AirPlay screen than is shown on the iPad's own screen.

    I'm looking to prototype an educational app where the teacher has a control surface on the iPad which controls what is displayed on the classroom projector or interactive whiteboard.

    (If Pythonista can't do it natively, I'll set up a Raspberry Pi as the classroom screen controller and write a simple control interface in Python to send HTTP requests to the Pi....)

    posted in Pythonista read more
  • Niall

    @abcabc
    The only wrinkle with your approach is that it would be too easy to work away on Pythonista and build up a working UI, only to forget which methods were available in the cross-platform version.

    The way I would solve this is by renaming the package (eg pythonistaui, and having two versions -- a Pythonista one and a Kivy one. The job of the Pythonista package would be to simply throw an error any time you tried to use something that isn't implemented in the Kivy version.

    In its simplest version, it would just be a list of imports, but that wouldn't deal with classes that didn't have all methods fully implemented -- in that case you'd have to build subclasses and override unimplemented methods to throw exceptions.

    If you are considering developing such a wrapper, I think the Pythonista version could probably be generated automatically with a bit of clever programming -- write a script that takes the ui spec from Pythonista, checks each function, class and method to see if it's available in your Kivy wrapper, and builds up the Pythonista wrapper from there.

    posted in Pythonista read more
  • Niall

    @Ti-Leyon
    Capital cases, lawyers be damned. You say this:
    "In the unfortunate event that the material should be reproduced, transformed or otherwise manipulated in whole or in parts then current local, state and international copyright laws should apply."

    What that means is that I can submit changes to your Git repository, but I can't actually any software with it built in, as that would be "reproduction". Thus any code I wrote with it would only be issuable in source form, for people who run a Python interpreter and who install your gui wrapper themselves.

    That means that I can't develop a package in Pythonista using it and then package it in XCode.
    It means I can't compile the package into an Android.apk or a Windows .exe .

    There is little point in me learning your API if I'm never going to be able to use it beyond tinkering for my own interest -- and if I'm tinkering for my own interest, then cross-platform dev clearly isn't a big issue and in the end I'd be just as well sticking with Pythonista ui or Kivy.

    posted in Pythonista read more
  • Niall

    Ah wait, sorry... I see what's happening here...

    "I splited them in 5 arrays"

    You don't want to do that. Each row of your file is a single entity and should not be split.

    You should read each row as a single array, tuple or dictionary. If you read them as a dictionary, use the solution I supplied above. If you're reading them as an array or tuple, modify the key in the code above to be 1 rather than "population".

    Check out the Python docs for the csv module to read your files in -- that does most of the string handling work for you.

    posted in Pythonista read more
  • Niall

    Because the items in your list are dicts rather than simple values (I'm assuming you used csv.DictReader to read in your file, and I'm going to call it list_of_dicts for clarity), there's no reliable automatic sorting. What you need is a "key function" that tells sorted how to determine what the order is.

    You need to either:

    1. define a function:
      def getPopulation (record) : return record["population"]
      and then call sorted with this as the named parameter "key":
      sortedValues = sorted(list_of_dicts, key=getPopulation)

    or

    1. provide an anonymous function (lambda) as the key parameter
      *sortedValues = sorted(list_of_dicts,key=(lambda x: x["population"])

    posted in Pythonista read more
  • Niall

    @Phuket2
    It's not just a question of Apple ceasing to provide OS updates for the device though, is it?

    The problem is first that they stop supporting the OS, including refusing to fix bugs they introduced in their latest versions. I'm having a lot of hanging and crashing in Safari, and the text-to-speech bugs @JonB mentions are a major issue to me as I was using my iPad and Pythonista to produce listening material for language classes that I could alter and repeat, slow down or speed up as appropriate to an individual class's needs.

    My device is now not simply "not updated", its most important function to me has been irresolvably borked. (And then of course there are the partially sighted users who rely on the availability of text-to-speech for most of their iOS usage.)

    Then we have the fact that you cannot load apps onto the iPad without using the iTunes App Store. The app store only holds one version of each app, so when one of my current purchases becomes iOS 10 only, I will no longer be able to reinstall. With less than 16 gigs to play with on my Mini, and with a habit of recording at high bitrates in Filmic Pro, I often need to drop apps off my device and reload them later, which I can no longer afford to do. Say I delete Filmic Pro so that I've got extra space to edit in Pinnacle Studio, and then when I go to reinstall Filmic, it says my device is not supported. Or if I leave Pinnacle off the iPad while filming and go to install it once I've finished filming and it complains that I've not got a supported version of iOS. In either one of these scenarios, I'm SooL. My portable combination of camcorder and edit suite is ripped from my hands when the hardware's still in a perfectly serviceable state.

    4 years might seem like a reasonable lifespan when compared to a laptop PC, but when you compare it to pro audio and video equipment (or even just consumer kit), it's not.

    posted in Pythonista read more
  • Niall

    As Lukas already asked: why? Why do you want to do this?

    posted in Pythonista read more
  • Niall

    I have a long-term natural language processing project that I've been working on for a while. Pythonista let me continue to work on it while I was on a month long cycle tour over the summer. (People thought I was mad when I pulled an iPad mini and a full-sized USB keyboard out of my luggage at the campsites, but it was much better than trying to transport even a netbook without damaging something.)

    Until recently I was also using it for small classroom tasks (as a teacher), but then Apple went and broke it on me -- the latest update of iOS 9 messed up the text-to-speech interface, and I was using high quality voices to provide listening material for language classes. I wrapped the whole thing up in a keyboard controlled interface to play the whole thing, step through line by line, repeat lines, slow down/speed up etc. I was able to produce anything I wanted, tune it to the class in question, and walk around with a Bluetooth keyboard controlling it from everywhere in the class.
    But iOS 9 won't get any more bug fixes (except serious security flaws) so now my most important use for the iPad mini (not iOS 10 compatible) is gone.

    Is there a decent Pythonista-like app for Android? I'm not sure I want to buy Apple again.

    posted in Pythonista read more
  • Niall

    Thanks, so that means I've got at least a year.

    posted in Pythonista read more
  • Niall

    I know Apple's policies end up meaning that app developers often have to abandon support for older iOS installations (e.g. when Apple mandated all new submissions be 16 bit). Is there anything on the Apple roadmap that makes it likely that future Pythonista updates will be unavailable on devices stuck at iOS 9? How long are those of us on older devices likely to continue to get updates?

    posted in Pythonista read more
  • Niall

    Aw boo. This an iPad mini 1, and iOS 10 won't be available on it, so it looks like I'm going to be stuck with this bug for the rest of time.

    posted in Pythonista read more
  • Niall

    No suggestions? I'm starting a masters in Computer-Assisted Language Learning and I'm really interested in being able to look at the use of voice sythesis in the classroom as part of it.

    posted in Pythonista read more
  • Niall

    When I was using the old Pythonista app on iOS 8, I started using the speech library to create live listening tasks for French classes. After first using the basic voices I decided to upgrade to the high quality voices, which are sometimes actually better than the hammy voice acting that comes with a lot of school books.

    At some point or other, I upgraded to iOS 9, and I don't know whether I used text to speech between then and buying the new Pythonista with both 2 and 3.

    So I started using text to speech with the speech library again last week, and the low quality voices were coming out. I reinstalled the old Pythonista... same thing.

    I've fiddled about with the settings on the iPad and checked the narrator in the web browser, and it's using whichever voice I like there. But Pythonista always seems to drop back to the first voice for the given language code, which is always low quality.

    What's going on? Does anyone have a workaround?

    posted in Pythonista read more
  • Niall

    @Phuket2
    Yeah, I was thinking of buying a wifi harddisk but wanted to check first if I might already have all the bits and pieces for a roll-your-own solution.

    I suppose the follow-up question would have to be whether anyone's had any success accessing the external devices from Pythonista -- i.e. do any of the major manufacturers have an app with any sort of open API we can access...

    Or maybe if I just went with one that uses FTP...

    posted in Pythonista read more
  • Niall

    Looks like a fun little project, but it doesn't address the biggest obstacle to Pythonista users -- the fact that there's no common GUI for Pythonista and other Python implementations.

    Do you reckon some of the basic UI elements could be abstracted to map onto both Pythonista's ui module and something else for other Python implementations?

    posted in Pythonista read more
  • Niall

    @lukaskollmer
    Sadly not jailbroken, and I imagine external drive access would make Pythonista too open to get through Apple's approval process -- it would let people do things like clear memory by exporting large videos to a non-MFI external disk (like I was hoping to do!)

    posted in Pythonista read more
  • Niall

    I don't see anything in the library docs about accessing the USB adaptor/camera connection kit. Is it possible to read/write external USB drives and/or flash cards from within Pythonista?

    posted in Pythonista read more
  • 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.

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!