the codes in picture could be run successfully,but i am confused.
i don’t know why i could’t use System variable directly in processing.py.
i see the System variable could be used directly in java(processing).
help me.thank you very much!
the codes in picture could be run successfully,but i am confused.
i don’t know why i could’t use System variable directly in processing.py.
i see the System variable could be used directly in java(processing).
help me.thank you very much!
class
instance fields.class
PApplet:def
we create a global
variable:__builtin__
property.this
or __builtin__
as a workaround:width = 640 # global width overshadows __builtin__.width
print width, this.width # 640, 100
def setup():
size(800, 600)
print width, this.width, __builtin__.width # 640, 800, 800
exit()
This is key. Don’t declare this globally. They exist globally already, and they are defined by size()
in setup()
. Call size, then use them.
Your words are clear,i understand now.
You are so nice.
Thank you very very very much.
Thank you very much.