omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. donnieh

    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.


    • Profile
    • Following 1
    • Followers 1
    • Topics 67
    • Posts 199
    • Best 11
    • Controversial 0
    • Groups 0

    donnieh

    @donnieh

    I am an electronic engineer based out of Buffalo, NY. I specialize in analog and digital hardware as well as circuit board design. A majority of my programming is in low level firmware for microcontrollers. I have learned C and C++ but recently fell in love with Python.

    14
    Reputation
    1738
    Profile views
    199
    Posts
    1
    Followers
    1
    Following
    Joined Last Online

    donnieh Unfollow Follow

    Best posts made by donnieh

    • Help with screen sizes

      I am try to get all the "different" screen sizes for each iOS device but I either don't own the device or the simulator (using old Xcode template) won't run 64 bit devices so I cannot test for them.

      Can anyone help me fill in the blank sizes? I have a few.

      I used

      import ui
      print str(ui.get_screen_size())
      

      iPhone4s_screen_size = (320, 480)
      iPhone5s_screen_size = (320, 568)
      iPhone6_screen_size = ()
      iPhone6P_screen_size = (414, 736)
      iPhone6s_screen_size = ()
      iPhone6Ps_screen_size = ()
      iPad2_screen_size = (768, 1024)
      iPad_Air_screen_size = ()
      iPad_Air_2_screen_size = ()
      iPad_Pro_screen_size = ()

      posted in Pythonista
      donnieh
      donnieh
    • plt in ui.view

      Most plt examples either display the plot in the console or save the image and display in ui.imageview().

      Is there a way to show it in a ui.view() without first saving a plt image?

      For example, what if I wanted an animated plot in a ui.imageview()?

      posted in Pythonista
      donnieh
      donnieh
    • 2018 Xcode template status

      Hi all. I have read through the forums regarding the Xcode template and I am concerned about using Pythonista for App Store submissions. Can anyone provide an update to the 2018 status?

      I may be wrong but this is my current understanding...

      • Apps written in python 3 cannot be posted to the App Store because that template doesn’t exists.

      • Apps written in 2.7 work with old template but have had a few issues.

      Is there some light anyone can shine on the Xcode template situation so we all can know what to expect? Has anyone submitted to App Store recently? If so, under what circumstances? I’d hate to spend 6 months of code development and hopes to publish on the App Store be crushed because the way I chose was not yet supported.

      Here me out: If Pythonista’s web page and website mention creating real Apps for the App Store, and there is only a narrow path to allow it, it should be outlined somewhere.

      Thanks for you taking the time to reply if you do. I’m about to send my first 2.7 app to the App Store and I am trying to learn where the template stands and what I am to expect.

      • Donnie
      posted in Pythonista
      donnieh
      donnieh
    • Does Pythonista allow use of iOS action sheet?

      What I am asking about:

      https://www.google.com/search?q=ios++sheet&rlz=1C1EODB_enUS522US522&espv=2&biw=1164&bih=817&source=lnms&tbm=isch&sa=X&ved=0ahUKEwj4z7fwmc_KAhXD1CYKHQprBlcQ_AUIBygC#tbm=isch&q=ios+action+sheet

      posted in Pythonista
      donnieh
      donnieh
    • RE: Xcode not showing Pythonista images or playing sounds.

      I am using template name "PythonistaProjectTemplate_160". Is this the latest?

      I would assume all those sounds and images that are new to Pythonista 2.0 are not in this old template.

      posted in Pythonista
      donnieh
      donnieh
    • RE: Help with screen sizes

      @Webmaster4o yes this is a good point, one that @dgelessus referred to above. The terms "Retina", "resolution" and marketing numbers like 2732 x 2048 (264 ppi) (for the iPad Pro) seem to have nothing to do with ui.get_screen_size().

      These are all referring to the amount of pixels. While if we could somehow programmatically get the the amount of pixels in x and the amount of pixels in the y it would be useful, I do not know how to do this. Using ui.get_screen_size() returns "points". These points are clusters of pixels. Using the points is fine for determine screen size as far as I seen though.

      This article is helpful. http://www.idev101.com/code/User_Interface/sizes.html

      posted in Pythonista
      donnieh
      donnieh
    • RE: HELP! How do I submit apps to the App Store from inside Pythonista?

      The Pythonista App submission process is very simple and easy to do. Basically dropping your python files in Xcode and running it. From there it is in the hands of your developer account.

      I started learning to write apps Apple's way. As in learn Objective-C and Xcode. Very hard thing to do. Then I tried Pythonista and it is the best Python IDE I have ever seen.

      Pythonista opened a lot of doors for me and helped me learn Python. There is nothing like it out there. And the community is great. Very professional people.

      posted in Pythonista
      donnieh
      donnieh
    • RE: Where is the latest Xcode template V2.0?

      The link for 1.6 Xcode template is taken down.

      posted in Pythonista
      donnieh
      donnieh
    • Where is the latest Xcode template V2.0?

      Is there a new template yet for Pythonista 2.0?

      posted in Pythonista
      donnieh
      donnieh
    • RE: webbrowser.open( )

      @mikael - thank you for the additional information regarding the Safari URL scheme. I understand your opinion about the use of the built in browser and I agree. I normally would create my own browser or launch in Safari as you mentioned.

      However, actually I have found it quite nice to have the webbrowser module if your stand alone app needs to display documentation, certain media, etc.

      posted in Pythonista
      donnieh
      donnieh

    Latest posts made by donnieh

    • RE: Pythonista 3 with iCloud. Can't sync between devices.

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

      posted in Pythonista
      donnieh
      donnieh
    • RE: Pythonista 3 with iCloud. Can't sync between devices.

      @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
      donnieh
      donnieh
    • RE: Pythonista 3 with iCloud. Can't sync between devices.

      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
      donnieh
      donnieh
    • RE: Publishing a UI Project to the App Store?

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

      import myapp
      myapp.run()
      

      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
      donnieh
      donnieh
    • RE: Publishing a UI Project to the App Store?

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

      View.present(hide_title_bar=True)
      

      Swipe down with 2 fingers to kill the script.

      posted in Pythonista
      donnieh
      donnieh
    • RE: Publishing a UI Project to the App Store?

      @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
      donnieh
      donnieh
    • RE: Publishing a UI Project to the App Store?

      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
      donnieh
      donnieh
    • RE: Pythonista bug

      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+")
      f.write(st)
      f.close()
      
      
      # my script below...
      
      ​```
      posted in Pythonista
      donnieh
      donnieh
    • RE: Pythonista bug

      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
      donnieh
      donnieh
    • Pythonista bug

      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
      donnieh
      donnieh