Is there a Xcode template available for Pythonista 3 ?
and at least : after verification ,code copied from this page produces the crash too.
More info, going deeper in my searches :
It looks like a text formatting issue...
Here is the code (but should probably not produce the crash because of text copy/past from the .py file to this page):
#This guy produces an hard crash on v2.1 from scene import * import sound import random import math #import photos class MyScene (Scene): def setup(self): self.background_color = '#ffffff' self.target = SpriteNode('iob:ionic_256') self.add_child(self.target) pass def did_change_size(self): pass def update(self): pass def touch_began(self, touch): pass def touch_moved(self, touch): pass def touch_ended(self, touch): pass if __name__ == '__main__': run(MyScene(), PORTRAIT, show_fps=True)
Do other people are facing this ?
Going forward to 2.1 from 2.0, I have a bunch of "hard crashes" (direct go back to ios, no error, no message) when using certain var names in my scripts (working on 2.0)
I had tracked the issue and discovered that vars names like "self.target" in scene produce 100% the crash, but using "self.Target" works.
It's probably a deep exception.
Any fix possible ?
I'm having the same objective : release a simple game, with adds to make (or not...) money via the app Store.
My researches brings me to Google Ads, and Google provide a Python version of their Ads API.
I hadn't gone more further in that (I'm not at this point of the project), but here is the Google solution :
I'm not sure it will be easy to use with Pythonista, or simply possible, but it looks promising and probably easiest than Object-C for Python programmers.
As I was talking about it in the "Next Pythonista Most wanted features" thread, I really think that being able to support such a feature in Pythonista should bring a lot of people to develop with.
I share my point of view here, in my specific context : Dummy in Python starting with Pythonista.
During the last weeks, I started a little game project to get more familiar with Python, and here are the most wanted features I have :
Communication between dev. target machine (iPhone, iPad, ...) and a desktop machine (Mac). This will extend drastically the quality of development environment, especially for long script, but also will help to integrate your own graphics, music, in an easy way. This can be :
More and more code samples in the reference documentation. Even if the documentation is really well done, dummies need help and as much examples as possible.
iAd module easy to use in Pythonista (apple advertising in apps or equivalent). This will help a lot developers to make money with their Pythonista projects, and then probably bring a lot more projects under this platform.
I admit that's a Christmas list :)
I'm seaeching the right way to make work an ObjectC line of code to disable the Idle timer on iPhone (screen goes darker)
The original line of code (found on the web) is :
[UIApplication sharedApplication].idleTimerDisabled = YES;
My side, I can't figure out how to use this exaclty. After a bunch of tries, no way to make it works.
Here is the non working code I tried :
from objc_util import *
#Switch off idle mode (ObjectC)
UIApplication = ObjCClass('UIApplication')
idleTimerDisabled = ObjCClass('idleTimerDisabled')
My_app = UIApplication.sharedApplication()
My_app.idleTimerDisabled = 'YES'
Any idea on the way to make it work ?