I have a module with the following code in a module named pytest1.py:
def addcount():
counter = 1
for x in range(10):
counter += 1
if counter == 5:
count = counter
print(count)
addcount()
I want to access 'count' variable in another module named pytest2.py I tried :
import pytest1 as p
print(p.addcount.count)