Closing one of python files in executable, not the whole programm

For my python app i need 3 files. One is the main code, another is file that deletes some stuff, and third file that combines them

import os
  
os.system('python index.py')
os.system('python delete.py')

The problem is that in the main file i have a line

os._exit(1)

It ends the main file and starts the deleting one. So when i compile it to .exe, the exit function ends the whole programm but not just one file to start another. I think i should somehow close only modules inside the executable, but i dunno how)


Ответы (0 шт):