def my_func():
return 'This is my func result'
In [1]: import my_file
In [2]: result = my_file.my_func()
In [3]: result
Out[3]: 'This is my func result'
In [4]: from my_file import my_func
In [5]: result = my_func()
In [6]: result
Out[6]: 'This is my func result'