Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Pythonista 1.6 Beta
-
@hyshai - Briarfox is correct that you should be able to just hack one of the examples and pickup a "Bean" peripheral and find its services and characteristics. You probably already have the LightBlue App already, so you can use its internal browser to check that your python code is seeing these things. The Bean docs are very unclear on how they expect you to access it and which characteristics to use. What I have learned is that they want you to communicate via one of the provided "Scratch" characteristics and not use the serial characteristic. The Scratch characteristics allow you to easly read and write up to 28 bytes of data. I have written Arduino sketches that do this and verified that the cb module can access these. I would like to get the serial communication method working as well because it allows you to access all the on board sensors without involving the Arduino. The Arduino part of the bean sucks down power rapidly so you can easily write sketches that don't do much but kill you battery within hours.
That's the good news. The cb module works fine for a single Bean. The bad news is that the cb module does not seem to be designed to support more then one peripheral at a time. I have four beans and have been struggling to write an app that can reliably browse and manage them. The cb callbacks run in multiple threads and I am having difficulty figuring out how to correctly deal with this. The code I currently have is way to ugly to share. You will notice from the docs and samples that did_discover_characteristics, did_write_value, did_update_value to not give you the peripheral that these callback are associated with so you have to match it up yourself and this is tricky.
There are also some other caveats. There is something going on with "weak references" that you have to be very careful with. The docs tell you to keep a reference to the peripheral object passed to you and this seems to be true of any other objects such as services and characteristics. If you don't keep a reference to these for the duraction of their use, you can see them get garbage collected on you and then you are in trouble.
I have also found out the hard way that the only reliable way to test a script is to completely restart Pythonista each time. If you don't do this, you can see the same periheral reported during a scan for peripherals with different object addresses. You can have "old" ones and "new" ones that are actually the same peripheral. The code I am currenty working on tries to cache references to all peripherals, services, and characteristics in a tree of dictionaries keyed by the uuid of the object. It should be easy, but I am learning python and don't know how to code it so that it is thread safe yet.
-
Hi @Omz. Sorry it took so long for me to get back to you, I was somewhat busy for a while.
Anyway, I found a few possible quirks.
<ul>
<li>[Major] Some scripts are deleted after accessing them, then closing the app. The file remains, but is blank when an attempt is made to access it.</li>
<li>[Minor] When typing, a random character is occasionally chosen between spaces, instead of the intended character. This might just be a problem with my keyboard, though.</li>
</ul> -
@TutorialDoctor, I just downloaded Workflow. It's a nice app, but the gallery doesn't display the top row of workflow categories on my iPad Air 2. Anyone else experiencing this problem?
-
@wradcliffe
Thanks so much for your thorough post - very helpful! I'm going to see what I can come up with using your tips and gotchas. -
I had an odd occurrence today in the IDE. I came back to my iPad after leaving it sit for a few hours. Went into Pythonista and found my self browsing in the App bundle section of the environment. It was COOL. When I moved down into Documents folder again it was all over and I can't say how I got into the place. Is there some trick to getting there in the IDE that is know? Now that I know it's possible - I want it!
UPDATE: I figured it out. Use importfinder to open up the code to a module like "wave" in the editor. Then make Pythonista exit while the editor is open. Start up Pythonista again and you find it browsing the directory where that code exists. It is a long way back from this location using the Back button to get to Documents again.
-
@wradcliffe, this has always been possible, albeit with the help of a few scripts. I don't think Apple's kernel sandboxing applies to the accessibility of the app bundle. The method in which you were able to access the app bundle is strange, to say the least.
-
Paramiko module version included in 1.6 beta?
This is a pretty minor question, but I thought I'd ask: Would someone helping with the 1.6beta mind checking this? (In REPL/Console just enter 'import paramiko;paramiko.__version__' )
Pythonista 1.5 comes with v1.13.0 of this module. I've been digging into the Paramiko APIs the past few weeks and was just wondering if the included version had been updated.
Thanks!
-
Just checked, the 1.6 beta has the same version of paramiko as 1.5.
-
Only a few more days till this beta build expires, a new one coming soon? Still some thoughts of mine:
- [Bug] When archiving a folder/picking a script to send as an email in the export menu, the email share sheet is never presented.
- [Bug] Some scripts are deleted after accessing them, then closing the app. The file remains, but is blank when an attempt is made to access it.
- [Feature Request] Color picker dialog
- [Feature Request] In form dialog - when a password field is added, can we set the placeholder to be in regular text instead of password (hidden) text?
- [Feature Request] iOS Calendar Module (similar to reminders module)
-
Will 1.6 include functional Xcode export? The current 1.5 template-based approach is broken with the latest Xcode.
Thanks.
-
Also what @glennholt said :)
-
@omz I'm starting to get a lot of pythonista crashes. It started in the last build and just before the current release, pythonista would not open. After updating to the current build, pythonista was working again. I'm starting to have issues again. When I backspace or paste into pythonista, it crashes back to springboard. It happens very often. I'm using an iPad Air latest iOS. I've cleared ipad memory and rebooted the ipad, neither seem to fix the issue.
-
@briarfox @omz I just started getting them too. I tried adding from Gist using the Workflow.app workflow and it crashed. I was at work so didn't have time to fiddle. Trying to open now and it crashes instantly, can't open at all. Reinstalled from test flight with no change. No I haven't tried restarting my device yet. I know.. I'm going to shortly ;)
Just wanted to let it be known after seeing the above post. Was going to wait until later, you know, after I tried restarting my phone, but I have the time right now so why not? Mine is on iPhone 5, latest 1.6 beta build.
-
@the_buch At least it's not just my ipad :)
-
@dgelessus: tnx! (re: Paramiko ver. in 1.6beta)
-
@ole Just updated to the latest 1.6. Just got a crash when I tried to paste ~2 lines. Lost 10 min of work :( Happens with both long press paste and cmd+v
-
@briarfox Do you remember where the text you pasted came from?
-
@omz I was text from lower in the script I was working on. Backspace when used to remove new lines occasionaly crashes as well. Ilm not entirely convinced that it is pythonista. I have reset my ipad air without much luck. I'm testing to see if it's possibly the bt keyboard. However, on the crash the current script loses all changes from when it was initialy opened. Seems to be the only way to save progress is to close pythonista after a few minutes work.
-
@omz Looks like it's my BT Keyboard, Just switched to an old one and no issues. Sorry for the hasty bug report.
Scratch that, Same issue with my other keyboard. Does seem to be caused by the BT keyboard. I have not had it happen with used the on screen keyboard.
-
FYI, sliding open the file browser on the left side saves the script as far as I can tell. There's no need to leave the app or open another file.