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.
Pythonista 3 Bug report
-
Traceback (most recent call last):
File "/var/containers/Bundle/Application/C653EC7F-B29A-4BAD-8AA1-1B562C926512/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/site-packages/scene.py", line 183, in _draw
if self.fixed_time_step and self.view:
AttributeError: 'MyScene' object has no attribute 'fixed_time_step' -
@wolf71 Can you please provide a small snippet of code than causes this error?
-
@wolf71 A common reason for this error is when you override
Scene.__init__
, but don't call the base class's__init__
method. -
import scene fmt = """Tilt your device to change colors... x={} y={} z={}""" class MyScene(scene.Scene): def __init__(self): # This scene runs itself scene.run(self, frame_interval=15) # Lower the FPS def setup(self): self.center = self.bounds.center() def draw(self): x, y, z = scene.gravity() r, g, b = abs(x), abs(y), abs(z) # No negative colors scene.background(r, g, b) scene.tint(1-r, 1-g, 1-b) scene.text(fmt.format(x, y, z), font_size=32, x=self.center.x, y=self.center.y) MyScene() # This scene runs itself
-
@wolf71 If you modify the following lines, the error should go away:
# ... class MyScene(scene.Scene): def __init__(self): scene.Scene.__init__(self) # <== IMPORTANT! scene.run(self, frame_interval=2) # ...
-
It's ok. Thanks.
The Pythonista 3 it's greate. upgrade from Pythonista 2.