I am using python and cannot solve the problem myself. I defined the variables(rb. data) in the 'main file' below. And I imported 'hp file' to use hotplate function. ( i611Robot, Teachdata, motionparam are included in 'A file' )
from hp import *
from A import *
def main():
rb = i611Robot()
data = Teachdata()
m1 = ....
....
hotplate()
if __name__ == '__main__':
main()
And this is the 'hp file' which is imported.
from A import *
def hotplate() :
rb.motionparam( m1 )
.......
But the problem is when I play 'main file', it says
File "main.py" line.., in <module>
main()
File "main/py", line ...., in main
hotplate()
File ".../hotplate.py", in line .., in hotplate
rb.motionparam( m1 )
NameError : global name 'rb' is not defined
I dont know how to use 'rb' defined in 'main file' when using in the function of 'hp file'