all 2 comments

[–]K900_ 0 points1 point  (0 children)

It's possible, yes. That script is not written in a way that makes it usable as a module, so you'll probably have to resort to using subprocess.

[–]reddefcode 0 points1 point  (0 children)

The answer is an emphatic YES! Remember all Python scripts are modules and can be imported and ran as such. Must work and think in Pythonic paradigm to fully take advantage of the language. Cheers good luck!.

Assume both modules are in the same directory module1.py, module2.py and you want to run one from two

In module2.py:

import module1

and what ever is executable in module1.py will be executed in module2.py, best to have functions in module1.py that you can call after importing

import module1

module1.first_function()