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.
What this error
-
Traceback (most recent call last):
File "/var/containers/Bundle/Application/F3A42D55-5CB1-4DC2-AFF5-5BE7BB053375/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/scene.py", line 161, in _setup_scene
self.setup()
File "/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/PPEasy/PPEasy.py", line 11, in setup
self.present_modal_scene(Lvl_1())
File "/var/containers/Bundle/Application/F3A42D55-5CB1-4DC2-AFF5-5BE7BB053375/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/scene.py", line 125, in present_modal_scene
other_scene.z_position = max(n.z_position for n in self.children) + 1
ValueError: max() arg is an empty sequencefrom scene import * import sound import random import math A = Action class MyScene (Scene): def setup(self): self.background_color = 'white' self.present_modal_scene(Lvl_1()) 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 class Lvl_1(Scene): def setup(self): self.main_node = Node(parent=self) self.bg_color = SpriteNode(color='blue', size=self.size/2, position=(self.size.w/2, self.size.h * 80), parent=self) self.name = LabelNode('tezt', ('Arial', 30), position=(self.size.w/2, self.size.h * 40), parent=self) class Lvl_3(Scene): def setup(self): pass class K_N95(Scene): def setup(self): pass class N95(Scene): def setup(self): pass class Papr(Scene): def setup(self): pass class Gowns(Scene): def setup(self): pass class Face_Shield(Scene): def setup(self): pass class Oxy(Scene): def setup(self): pass class Alcohol(Scene): def setup(self): pass class Bleach(Scene): def setup(self): pass class Ammonia(Scene): def setup(self): pass class k_n95(Scene): def setup(self): pass if __name__ == '__main__': run(MyScene(), PORTRAIT, show_fps=False)
-
@resserone13 it seems that the reason is that your main scene is empty
-
@cvp If I remove present Modal seen it works
-
@resserone13 so it works also
class MyScene (Scene): def setup(self): self.background_color = 'white' self.main_node = Node(parent=self) self.present_modal_scene(Lvl_1())
-
@cvp right. It looks like I needed to add a node. Thanks as always. I’m Going to make a simple app real quick to explain the difference in the types of protective masks. I work at a hospital and you’d be surprised how many people are confused on which masks are for what. I’m not sure how I can actually get it into an app though. The app itself is just going to present pictures and texts. I wonder how hard it would be to package it up.
-
@resserone13 try, the line is the line that generates the error
class MyScene (Scene): def setup(self): self.background_color = 'white' try: print(max(n.z_position for n in self.children)) except Exception as e: print(e) self.main_node = Node(parent=self) print(max(n.z_position for n in self.children)) #self.present_modal_scene(Lvl_1())
-
@resserone13 said:
Going to make a simple app real quick to explain the difference in the types of protective masks.
Would like To help but Can't imagine how
-
@cvp that sounds good. Once I get I done which should be in the next day or 2 I’ll post it on GitHub or the forum and let you know. It should be pretty simple. Each scene will have a title, a picture of the mask, and a description of when it should be used. I’ll let you know.
-
This post is deleted! -
I was still busy to debug, too long text...
-
@resserone13 try
self.text = 'This is a level 1 mask. \nThis mask is suitable for general\n areas such as lobbies or the cafeteria. \nIt is NOT recommended to ware a Level 1 \nwhile working with patients'
-
wear
a mask, notware
a mask -
@resserone13, for your app, this could work really well: