It is necessary that one script calls another, how to do it? Scripts are in the same folder. No, it is impossible to merge into one file in advance.

2 answers 2

And you can be more precise, what exactly is needed? Integration of the code into globals() is done like this:

 execfile("filename", globals()). 

Call from console:

 import subprocess; subprocess.Popen("filename", shell=True) 
  • Emm .. code integration is not needed .. There is a script 1 .. all his work is to call script 2, nothing else ... At the same time, 1 script turns itself off - Daniel Kolyasnikov
  • one
    Then import subprocess; subprocess.Popen ("filename", shell = True) - mrDoctorWho

It is done as with ordinary modules through import. There are several ways well described.

  • This is just a merging into one file, you immediately need to perform 2 different programs ... - Daniil Kolyasnikov
  • On the link, methods are described without merging, through the system for example. - Kozlov Sergei