• cappy

    I agree somewhat.
    So how is it that Apple allowed Pythonista to slip through their cracks?
    I'm actually amazed that it exists and doesn't get pulled

    posted in Pythonista read more
  • cappy

    Let me rephase this differently...

    In Pythonista, can I write a script to move a slider in one of the GUIs in iOS, such as the Wifi Enable slider?

    posted in Pythonista read more
  • cappy

    @dgelessus said:

    Out of curiosity, in what situation do you need to physically turn off Wi-Fi (instead of just disconnecting) and airplane mode is not a solution?

    Turn on Airplane Mode, Wifi & BT are Off.
    Leave Airplane Mode on, turn on Wifi. Wifi comes on, Airplane mode is still on.
    This doesn't make sense. You can't be in airplane mode if you're transmitting.
    So, I never use Airplane Mode.

    I was hoping to put a script shortcut on my homescreen so that i can enable and disable Wifi, without having to go to settings. The Buttons in Control Center are useless.
    I don't want wifi/BT on due to the battery drain (especially in ios 11), I want the radios off.

    posted in Pythonista read more
  • cappy

    @dgelessus said:

    I haven't installed iOS 11 yet - did the Wi-Fi switch get removed from the control center or something?

    Yes, the button in control center does NOT turn off wifi and bluetooth, it only disconnects the current session.
    If you want to turn either off completely, you need to go to settings.

    posted in Pythonista read more
  • cappy

    Since Apple did a bad thing in iOS 11, the user now has to go to settings, WiFi, then turn WiFi on or off. In iOS 10 and earlier, you could swipe up then enable/disable WiFi. Much easier.

    I’d like to make a script that can do the same, without me having to go to settings to enable/disable. ( the same goes for Bluetooth).

    Can I do this in Pythonista?

    posted in Pythonista read more
  • cappy

    Got it.
    I hadn't seen that screen before

    thanks

    posted in Pythonista read more
  • cappy

    When I create a new subdirectory, it always gets created as Untitled.
    I've tried renaming it, but this ends up creating a subdirectory inside of the Untitled directory.

    How do we create directories with a specific name?
    How can I delete a directory?

    I have these problems with both version 2 & 3

    posted in Pythonista read more
  • cappy

    Thanks- but HOW do you move the scripts from v2 to v3?

    posted in Pythonista read more
  • cappy

    I have both version on my iPhone.
    Is there any need for both? Can I just delete Pythonista 2?

    Is there a straightforward way to get my scripts from version 2 into version 3?

    Thanks

    posted in Pythonista read more
  • cappy

    @ywangd I've just installed Stash. How do I cd to the Home directory? I'm not familiar with the iPad file system.

    "Please run launch_stash.py under the Home directory to start StaSh."

    posted in Pythonista read more
  • cappy

    Here is a link to my current code, with the Ctrl-C handlers added.
    I haven't been able to duplicate the unresponsive X button with this code as of yet,
    but I do see an occasional exception.
    Dang- I forgot about this dorky forum software- not taking attachments. Can we get some decent forum software going here so we can post attachments directly??
    This is really annoying.

    Here's the exception screenshot

    Here's the current code
    http://pastebin.com/fMc42Trp

    posted in Pythonista read more
  • cappy

    @ahenry91

    I think calling exit() in the thread isn't a good idea. Better to let main exit under controlled conditions in case some cleanup is needed.

    I ended up adding a KeyboardInterrupt handler in the thread AND in main().
    You don't know where the execution will be when Ctrl-C is sent. I wanted both bases covered.

    The Ctrl-C handler in the thread simply prints a message (so I know which handler caught the Ctrl-C), then calls self.stop(). The thread just exits gracefully.

    In main, the Ctrl-C handler checks if the thread is running, if it is, self.stop() is called, a message is printed, the loop broken out of.
    Sorry I didn't paste my code, I had to fix a broken drawer last night. It took longer than expected (but my head was thinking about this thread hang issue) ;-)

    I didn't see the original hang problem, but when I run my solution, 1 out of 6 times I do see an exception related to the thread switching.
    I hope to paste that code tonight.

    I need to run at least 20+ times to make sure the hang doesn't occur again.

    posted in Pythonista read more
  • cappy

    @Tizzy said:

    swiping back to the script page and hitting the stop button there
    What do you mean? The script page was visible, no swiping was needed.

    posted in Pythonista read more
  • cappy

    @Webmaster4o said:

    Second, to quit the app, double-click the home button. You'll see all your recent apps. When you see Pythonista, swipe up on the window >>to quit the app.

    Are you stating that if I don't swipe to remove an app, that it will continue running in the background?
    If so, I wasn't aware of this.

    posted in Pythonista read more
  • cappy

    @ahenry91
    Notice that the X button above the code Window is disabled.
    The X button above the console appears to be enabled, but has no effect.

    Also note that I intentionally entered 1/0 in the console prompt, hoping to force a DivisionByZero exception. No affect, the exception was not raised (at least in the current thread)

    posted in Pythonista read more
  • cappy

    @Webmaster4o said:

    Second, to quit the app, double-click the home button. You'll see all your recent apps. When you see Pythonista, swipe up on the window >to quit the app. Now, when you return to the app, your problem should be solved.
    Will try tonight when I get home. I know how to catch KeyboardInterrupt, I just didn't know how to send Ctrl-C

    Thanks

    posted in Pythonista read more
  • cappy

    If you look at the console view on the side, the [X] is able to be pressed.
    The X button on the right side (console window) did not respond, it acted like it was disabled.
    What is the difference between the X button above the Code window (the one that appears after Start is pressed), and the X button in the console window.

    Chances are- in order to duplicate the issue I saw, you may have to run the script and stop it manually, before the thread exits, several times before you see this problem. (That is, run the script, wait until you see some output in the console, and Press X)
    Of course, duplicating this issue is likely to be related to background activity in iOS.

    I'm running an iPad Air264GB, with iOS 9.2

    posted in Pythonista read more
  • cappy

    @Webmaster4o said:

    I'm fairly certain that the [X] button sends a Ctrl-C signal when pressed. That's how it stops the script
    The X button was disabled.

    Did you try removing Pythonista from the app switcher? Quitting the app almost always helps
    No, don't know how to do that.
    As mentioned, exiting Pythonista did NOT help. I had to reboot the iPad.

    This looks like a bug with docked console, and things not updating. I notice that the [X] button also appears in the console window on >>the side, where it is lit up. Did you try pressing that one as well?
    Again- the X button was visible but DISABLED. It cannot be pressed. The screenshot is misleading, as you cannot tell that the button is not enabled to be pressed.

    posted in Pythonista read more
  • cappy

    Is there a way to attach files to these posts, so Dropbox links are not needed?

    Thanks

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!