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.
Syntax Error add_subview line 23
-
@sendog3c missing quote, thus "end )" is commented, thus no "end )", thus next line is part of the statement, etc... 😀
labelmain = ui.Label(alignment=ui.ALIGN_CENTER,bg_color='#fafafa',border_color='black',border_width=1,frame=(100, 150, 300, 40),name='labelmain',text='WELCOME TO HABITfun', text_color = '#0d60fd')
Color of ) should show you where is the error
-
CVP
thank you. You are a helper 😌😌
-
@sendog3c That's not what my wife says 😂
-
@cvp. You should convince your wife to do https://en.m.wikipedia.org/wiki/Pair_programming with you.
-
Can make you a theory question ?
-
@ccc My wife is an artist and she hates computers...
-
-
jejeje nice jokes
-
@sendog3c My "?" was about your theory question
-
My question are basically: how do I have to structure my code; by example: the entire code in only one *.py file or should I divide it in parts; and if it better in parts how to do that?
Thanks.
-
-
@sendog3c, see one big comprehensive answer here.
For my Pythonista coding and fun projects, I mostly stay in one file until:
- It is too long to keep scrolling up and down on the phone
- Or I need to develop in two locations at once, in which case it is more convenient to jump between two files = tabs
- I have alternative components that you pick from when importing, like different storage backends
- Or the project gets really big and splitting into logical files and folders is necessary just to find things
-
Thank you CVP & Mikael. I am going to read the article prior to continue. But a last question for instances:
How do I call a .py from another .py when running your program?
-
@sendog3c If you need to call some def's, easiest way = import, like you do for standard modules:
p1.py ===== def my1(): ........ p2.py ===== import p1 p1.my1()