• It seems that the undo button is back on the iPad, and the "pressing enter after an empty space" issue is gone on both the iPad and the iPhone. A couple issues still remain, but this is great. Thanks.

  • Flask's auto-reloader doesn't work in Pythonista because it would require spawning subprocesses which isn't possible on iOS.

    You can pass use_reloader=False to app.run() though, and debugging should still work.

  • @omz I learn every day...
    One more time, Thanks for your marvelous application, it has changed my life, really.
    I'm retired, I was reading a lot, and now, I almost only use your app.
    That's why all my files are now on my iPad, and my Mac is only used as a backup

  • Thanks for your help, but it was, one more time, a programmation error.
    I'll become a big specialist of the 17th line of @jonB 😢
    My script compares my 25000 files, local vs Mac, by checking their size and ctime on both sides.
    As the FTP scan of the Mac takes 8 minutes, I store the list of the remote files in a local file (of course, upon request, the script is able to rescan the remote server and recreate this file). The file is the str(dict) and the dict contains size and crime of both sides, and my bug has been to also store the local data in this file, thus I "believed" that the file did still exist because my script showed its size/ctime even if the file was no more existing... Sorry for your time, but at least, I'be learned chmod and ls in stash.
    Do you think I need to entirely remove this topic or do I let it as "mea culpa"!

  • Unfold the pink sheet and press "print traceback" then go into the console

  • Once you have successfully installed StaSH then you need to reboot Pythonista and open the launch_stash.py script and run it. You should then be able to type pip -h.

  • If you have an example, that would be most welcome, JonB.

  • Cool, thanks! 😊

  • Thanks for the all the help. Gonna try it tonight!

  • I have posted a script on my GitHub repository that expands the use of the GUI_Helper.py file. It is available here. The script uses the excellent file picker code in GUI_Helper.py to browse and select a pyui file in the Pythonista documents directory, and then returns a text file of the attributes of the view and subviews in the selected pyui file for copying into the code of a .py file. The text is displayed in the Pythonista console and copied to the clipboard. This allows for an easy transition from two seperate files into a single .py file when using a ui.

  • Other ideas...

    import appex import requests import ui from objc_util import ObjCClass l = 0 device = ObjCClass('UIDevice').currentDevice() device.setBatteryMonitoringEnabled_(True) battery_percent = device.batteryLevel() * 100 device.setBatteryMonitoringEnabled_(False) off = True hum = 0 tem = 0 url = 'http://www.apple.com/#' # Added url definition # Do not worry about this, this changes my lights but will disable if I'm not # at home def button_tapped(sender): global l l += {'+': 10, '-': -10}.get(sender.name, 0) l = min(max(l, 0), 100) print('{}: {}'.format(l, requests.get(url + str(l)).text)) response = requests.get(url) tem = response.text if response.status_code == 200 else ' -- ' info = html = response.text def main(): label = ui.View(frame=(0, 0, 320, 64)) helv_15 = ('HelveticaNeue-Light', 15) # TEMPERATURE label.add_subview(ui.Label(frame=(1, 0, 100, 0), flex='wh', font=helv_15, text_color='white', alignment=ui.ALIGN_LEFT, text='Temperature:' + str(info)[3:7] + '°')) # HUMIDITY label.add_subview(ui.Label(frame=(1, 0, 150, 32), flex='wh', font=helv_15, text_color='white', alignment=ui.ALIGN_LEFT, text='Humidity:' + str(info)[11:13] + '%')) # LIVING ROOM LIGHTS monla_15 = ('Monla', 15) living_title = ui.Label(frame=(320 - 135, 0, 130, -20), flex='wh', font=monla_15, alignment=ui.ALIGN_RIGHT, text_color='white', text='Living Room Lights') # GREETING (WIP) greet = 'hi' # LIVING ROOM BUTTONS plus_btn = ui.Button(name='+', image=ui.Image('iow:ios7_plus_outline_32'), flex='hl', tint_color='#666', action=button_tapped) plus_btn.frame = (320 - 64, 0, 64, 64) minus_btn = ui.Button(name='-', image=ui.Image('iow:ios7_minus_outline_32'), flex='hl', tint_color='#666', action=button_tapped) minus_btn.frame = (320 - 64, 0, -64, 64) if tem != ' -- ': label.add_subview(minus_btn) label.add_subview(plus_btn) label.add_subview(living_title) else: # GREETING label.add_subview(ui.Label(frame=(320 - 135, 0, 130, -20), flex='wh', text_color='white', font=monla_15, alignment=ui.ALIGN_RIGHT, text=greet)) # BATTERY if battery_percent >= 85: img = 'full' elif battery_percent >= 50: img = 'half' elif battery_percent >= 30: img = 'low' else: img = 'empty' bat = ui.Button(name='batteryl', flex='hl', tint_color='#00d500', image=ui.Image('iow:battery_{}_24'.format(img)), action=button_tapped) bat.frame = (320 - 30, 64, 32, 32) label.add_subview(bat) # BACKGROUND COLOR label.background_color = '#1a1a1a' # SETS WIDGET appex.set_widget_view(label) if __name__ == '__main__': main()
  • @zSaaiq ... You could try changing line 5 from:

    from objc_tools.objc_json import objc_to_dict # to from objc_json import objc_to_dict

    In general, I think that __init__.py files are needed in the directories of objc_tools as described in: https://docs.python.org/3/tutorial/modules.html#packages and http://mikegrouchy.com/blog/2012/05/be-pythonic-__init__py.html

  • I know this is an older thread, but I just wanted to confirm that with the texinfo fix, I have successfully submitted and had an app approved in the last few days.

    So the fix is required to get past the automatic filter, but submission is OK with the workaround.

  • Instead of using ast, you might consider using inspect.get_members() like in https://github.com/cclauss/Ten-lines-or-less/blob/master/platform_info.py

    dir() is also usable for quick and dirty scripts.

  • Really stupid bug, just near line 17.😤
    I had subs, for connecting, sending, deconnecting and I have integrated all theses subs in an inline code because I thought it would be easier to set it as able for multi thread due to a lot of variables (not easy to explain). And so, just before my storbinary line, I added an if (bad invention, isn't it?) and it was always False and my storbinary was not executed, thus also not it's callback. So easy, but I swear, I've tested during hours, and after your post, I've just done a code review...and I found this 🐜
    Thanks for your patience for helping us so much.

  • Support for inline footnotes is the only thing holding me back from purchasing the app at this time.

  • @ccc Whatever jailbreak detection methods there may be, they probably won't work reliably if the user has some sort of "jailbreak hiding" utility installed. And those are the ones which tend to cause problems with Pythonista, like incorrectly preventing it from writing to its own files in ~/Documents. Pythonista runs fine on jailbroken devices in general, as far as I know.

Internal error.

Oops! Looks like something went wrong!