I'm trying to access variables I created in one function inside another module in Python to plot a graph however, Python can't find them. Heres some example code:
class1:
def method1
var1 = []
var2 = []
#Do something with var1 and var2
print var1
print var2
return var1,var2
sample = class1()
sample.method1
here is class 2
from class1 import *
class number2:
sample.method1()
This does as intended and prints var1 and var2 but I can't call var1 or var2 inside class number 2
FIXED EDIT: Incase anyone else has this issue, I fixed it by importing this above class two
from Module1 import Class1,sample
And then inside class2
var1,var2 = smaple.method1()