I have the below code,
def hello(start, end):
perform some function
for i in range(j):
yield (some value)
yield (some value)
def calc(start, end):
start = "x"
end = "y"
for d in hello(start, end):
perform some function
data = 123
perform some function
data1 = 456
return data, data1
def world(hello()):
with open(r"C:\filepath\abc.json",'w') as file:
json.dump(hello.data, file)
with open(r"C:\filepath\abc.json") as file1:
d = json.load(file1)
return d
- Now, I want to use return values(data & data1) from hello() function in world() function, also want to use return values from world() function in another function.
- Also, the world() function will be imported as a module and should be used in function in another module.
How could I do that?