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.
New Xcode Template (beta)
-
I've made a new Xcode template for turning Pythonista scripts into apps. It's based on the current beta of v. 1.6, so it's work-in-progress...
Some notes:
-
64-bit devices (iPhone 5s/6, iPad Air...) are supported now, but the 64-bit simulator isn't, so if you want to run your app in the iOS simulator, please choose a 32-bit device (e.g. iPad 2 or iPhone 5).
-
It's now easier to include pyui files, images etc. Just put them in the
Script
folder, next tomain.py
, and they should be installed automatically when you build the project. Anything that is in this folder will be copied to the documents directory of the app, so you can access those files just like you would in Pythonista, and things likeui.load_view()
should "just work". -
In previous versions of the template,
matplotlib
wasn't supported, this should be fixed.
Download: → PythonistaProjectTemplate_160.zip (101.8 MB)
Please let me know if you have any problems getting this to work.
-
-
@omz, thanks for putting time and effort into this. I'm hoping to test some of the ui-tutorial scripts in the old and updated project template over the next few days.
While this is not your main focus in updating Pythonista, I hope the output of those tests - conducted by me or someone else - will help guide the app development.
-
Hi, I tested the script using canvas module,
but the program has stopped with an error below.Error (line 2): No module named canvas
Do not support "canvas" in this version ?
-
Thanks, could be that I forgot to include that, I'm looking into it.
-
...should be fixed now.
-
Note that the simple crash in the TableView UI from the ui-tutorial, as reported here is fixed in this latest Xcode template.
-
@omz, Thank you.
now canvas is OK.The result of the last line's 'print "Selected File ="...' in this " file selection script " is not displayed.
It displays in v1.5 or Pythonista IDE.
Does this script is wrong ? -
UI works fine, but it possible to end the UI with the two fingers gesture which leaves the app in an unusable state. Is it possible to add a configuration switch for disabling the gesture or to disable it when running as separate app outside pythonista?
Files dropped in the Script folder are read only in the documents folder after 'xCoding' (?) How can I add a file which I want to edit or to replace from outside (f.ex. a database file updated via iTunes/UIFileSharing)?
Regards Tom
-
UI works fine, but it possible to end the UI with the two fingers gesture which leaves the app in an unusable state. Is it possible to add a configuration switch for disabling the gesture or to disable it when running as separate app outside pythonista?
I have that on my todo list.
Files dropped in the Script folder are read only in the documents folder after 'xCoding' (?) How can I add a file which I want to edit or to replace from outside (f.ex. a database file updated via iTunes/UIFileSharing)?
If I understand you correctly, the easiest way would be to enable iTunes file sharing for the app. Just open the
Info.plist
file in the project, add a new row (select the last row and click the '+' button), enterUIFileSharingEnabled
as the key, and selectYES
for the value. When you deploy the app to a device now, it should show up in iTunes' file sharing interface. -
@OMZ: That's exactly what I have done.....and it is not my problem.
An example: in folder scripts I have three files (main.py, main.pyui, bes.db). All the files will be placed in the documents folder and can be accessed in iTunes. So far it is working well.
Now I replaced the bes.db via iTunes and start the program again. Surprise! The new bes.db will be overwritten with the old one and is gone. Another look into documents will show up the old version again.
Have I done something wrong?
-
OMZ,
Thanks so much for your effort. I can get an app to build, but when I try to add the .ipa to my device (ad hoc via iTunes) it says that it cannot be added because it's not a valid app.
I have a valid bundle ID, the info.plist looks OK, I can't figure out what it is. My PyCharm/Kivy-ios builds and techBASIC builds work fine.
Any thoughts?
-
OMZ,
FYI, I just replaced your info.plist with one from a working kivy-ios project and that works OK. Update: A newbie error I guess -- apparently the LS key LSRequiresIPhoneOS is required to build an app!
-
Love the new template! One thing: I can't seem to get the Pythonista 1.6/iOS 8 document picker in the
dialogs
module to work. Launching it makes my app crash. Any suggestions?Thanks!
-
Quick tip: one of the differences between the previous template and this latest one, is that the "Skip Install" flag in the Build settings is set to Yes. This means that when you create an App Archive for submitting to the store, it doesn't automatically export it to your Organizer Tool.
I haven't gone through the whole pipeline with this project template yet: script in Pythonista on the iDevice -> porting script to Xcode -> debugging in Xcode -> submitting to store -> distributing on store; it's not a priority for me at this point, but I have been playing with some of the settings. You've given us a good tool, @omz, to learn Xcode at a very superficial level, thanks. Anybody gone through the whole pipeline yet?
-
@dvader9: I've done ad hoc deployment to local iPads. The template works well on the few examples I've tried. The modifications I had to make to the info.plist file are the "LSRequiresIPhoneOS" key as I mentioned above and that "Skip Install" flag in the Build Settings that you mentioned.
The kids in my class will soon be creating apps for submission -- I'll let everyone know how that goes.
@OMZ: Thanks again for all your work!
-
I was this close to posting a bug report about how I couldn't run the vanilla template. But then I read the part about using a non-64 bit simulator.
Anyways. THIS IS AWESOME! I'm excited.
Oh yea - will this not work for UI generated using the 1.5 version of pythonista?
-
@omz This is probably a question directly for you.
When running an app built with the Xcode template, the launch screen/image is shown and then a screen similar to the Pythonista console is shown for a few seconds. After that the app starts.
I assume the console-like screen is loading up Python and all your code, but is there a way to overwrite this screen and possibly continue to show the launch screen/image defined in Xcode (or a custom image of some sort)? This would make the transition from launch screen to app much smoother looking.
-
I was also curious about the question above. Not having a smoother transition from splash screen to app could hurt overall ux. @andymitchhank have you tried dropping the splash screen? Do you still see the "load" page so to speak?
-
@jfryznke Just tested your idea and, unfortunately, the load page was still visible for a few seconds before the application loaded.
-
@andymitchhank hmmm, hopefully @omz has a solution. I haven't come across this anywhere else in the forums or in my own experience using pythonista/xcode. I haven't taken anything COMPLETELY through the pipeline yet, so I'm not sure if I would encounter a similar problem but I love to troubleshoot before I get there and help others troubleshoot to learn from their experience. Keep me posted on your progress and I'll update you if I have a similar issue.
In my other xcode experiences using a language other than obj c, I've never seen/heard something like this...it is intriguing.