I have a test2.py file containing:
if __name__ == "__main__":
print("Hello World")
and a test.py file with which I'm trying to run test2.py. I have tried
import os
os.system("python test2.py")
and
import subprocess
subprocess.call("python test2.py")
cmd = "python test2.py"
subprocess.run(cmd)
But none of these give me any "Hello World output". It seems that it is running the python file but without giving me any output. Would anyone know why exactly?