• donnieh

    @mikael Understood. Thanks for the useful and helpful information!

    posted in Pythonista read more
  • donnieh

    @mikael wow good to know. What do I have to do to run github code right in Pythonista? I never used GitHub and will have to quickly learn.

    posted in Pythonista read more
  • donnieh

    Hi there. If you have a iPhone 4S, the latest OS is iOS 9.3.6. iCloud Drive support on there is old and shady. The iPhone 6S is a little outdated but should be fine.

    However on a new device Pythonista doesn’t behave with iCloud Drive so great. I run my projects right out of the iCloud drive folder to keep things safe. I learned sometimes my project won’t load and the app will lock up because the iCloud-Pythonista syncing is very slow.

    For the most part all works good. You have to have good hardware to run Pythonista well.

    posted in Pythonista read more
  • donnieh

    @henryaukc For option 3, main.py could maybe be:

    import myapp

    This is what the user would see if they ended up at the code editor. It is basically calling your app as a module. It is not a good solution but they will not easily be able to edit your code if the script stops. It there is an error with an input, Pythonista may bring the user to the source code though :(

    posted in Pythonista read more
  • donnieh

    @henryaukc To present a view without the x button, use the hide_title_bar=True parameter.


    Swipe down with 2 fingers to kill the script.

    posted in Pythonista read more
  • donnieh

    @henryaukc I know you cannot go to the home screen from a script, but I have done both of the below methods.

    1. Just call another app using the url scheme. For example, you could call the settings app. It doesn't get you home but it exits the app.

    2. I have called a script before from my main script( the App ) where the called script was designed to crash pythonista. (Cringing is expected). It is such a dirty way, but it brought me to the home screen instantly when I needed. You can also open Safari with a bogus URL and get it to crash, leaving you at the home screen. Obviously these options are grabbing at straws but I'd thought I would share.

    posted in Pythonista read more
  • donnieh

    Hello. I have a couple simple apps on the app store (https://itunes.apple.com/al/developer/donnie-herman/id837266303) and more on the way, so I may be able to offer some information about your options. I provided 3 options I know of, starting with the most elegant method moving to the least elegant method. Method 1 and 2 require a Mac.

    1. Publish on App store. Create an iOS developer account and publish the app through Xcode. The App store requires a $99/year fee. You can submit apps there free for download, even if it has a limited user base. It requires some time to get all the icons and description Apple worthy, but it is smooth sailing after that. Apple will reject it if it has no lasting value for the customer. However, if it is presented as a tool, Apple will not be so strong on the criticism as it is hard to gauge if it is functional value or not. Once on the App store, it will require some maintenance over time as iOS updates. App store apps should be updated at least once a year by compiling under the latest Xcode. You can also distribute the app via TestFlight and share a download link. You do not need to have it approved on the app store for Test flight, but will still have to pay $99/yr.

    2. Manually install the app on the device. If you can physically hold the device in your hand, you can do the following.

    • Run your Pythonista app in Xcode using @omz's Xcode template.
    • You can test your app using the iPhone simulator or by plugging in the device.
    • In this case plug in your family members phone or iPad to a MAC and run Xcode pointing to that plugged in device. The app will install on their phone and will work just like an App store app. You can disconnect the phone and that family member is set run the app anytime like normal.

    Be aware that this app will not be updated or supported in any way, but only by manually installing via Xcode. It is possible an iOS update can break your app because the python APIs can become deprecated, and a app reinstall will be needed. Right now I have a bunch of real apps on my phone written in pythonista that I installed via Xcode. A great way to run unauthorized Apps.

    1. Create a Pythonista script shortcut on the home screen or use the URL scheme. This is what @Phuket2 mentioned but I have done a twist on this to prevent exposing the code for accidental editing. One thing I do is I run the main program as a module, and call it will a different .py file. So if the user gets brought to Pythonista code editor, they only see the module being called and not the source code.

    Good luck!

    posted in Pythonista read more
  • donnieh

    Ok, I have some more information about this. It happened again last night, but it didn't require changing the font setting. I switched back and forth between my main.py file and the documentation tab. When I return back to the .py file it updated the editor text with code that was about 5 min old.

    I immediately cut all my internet (airplane mode within 1 second) so no further iCloud syncing could happen. My internet was on 3G so syncing was slow-ish.

    I then download Pythonista to another iOS device and allowed iCloud to sync the files it had. Wouldn't you know!? The iCloud version was the 5 minute old file!

    I am wondering if the Pythonista editor refreshes the current editor text with the iCloud version .py file even if it is older or not fully synced. I am not sure if my assumption is truly correct, but I wanted to share this issue. Maybe it is something I am doing wrong.... I believe this issue is isolated to the iCloud folder. I never seen this until I moved my project to from the phone folder to the iCloud folder.

    For now, I just added the following code to my project so it archives everytime I run.

    # Back up script to text file before running
    import editor
    import datetime
    st = editor.get_text() # script text
    dt = str(datetime.datetime.now())
    f = open('Backup '+ dt, "w+")
    # my script below...

    posted in Pythonista read more
  • donnieh

    I am pretty sure my code is gone. If it can't be retrieved, at least this bug can be fixed so it doesn't happen again.

    posted in Pythonista read more
  • donnieh

    I am deep into a pythonista project saved in the iCloud folder. The code was a few hundred lines long so I went to the gear icon to reduce the editor font size. I changed it from 12 to 10 to see more code on my iPhone.

    Then went I went back to the main file and the editor updated the code to the new font size by flashing the screen, but I noticed it also overwritten my code with old code from 2 days ago. A lock icon showed up at the top but doesn't anymore.

    1. Why would changing the font size erase my latest changes from the last 2 days?
    2. Is there any back up in the app somewhere or some cache or something? I want to find this code it just erased.

    I am very discouraged about this and feel like shelving my project because my best work and solutions were made over the last 48 hours.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!