It is not possible to do what you're asking for, and it has nothing to do with the fact that your code resides in two different files. You would still have the same issue if you were trying to access a function's local variables inside the same file the function is declared.
The reason why you can't do this is that value is a local variable of function ask. This means that this variable will be pushed onto the stack whenever the function ask is called, and then removed once the execution of ask is over. So, it doesn't exist outside the scope of function ask's execution. You can understand why this happens by considering the scenario below:
def f(a):
value = a + 2
Now, the value of variable value is not clear except for when the function f has been called. (f(2) would mean that value == 4, but f(3) would mean that value == 5).
But, if you have a variable whose value doesn't depend on any other arguments to the function, you can either declare it global (wouldn't recommend it), or make it a static variable like below:
class Ezber():
def ask():
# do something
pass
Ezber.ask.value = "test string"
print(Ezber.ask.value)
Or, if you want the initialization to happen inside the function, you can do:
class Ezber():
def ask():
# do something
Ezber.ask.value = "test string"
ezber = Ezber()
ezber.ask()
print(Ezber.ask.value)
But as you can see, you'll need to at least call ask once before you can access value. (since value is initialized only when ask is executed).