Python Forum

Full Version: Keep Application running after Python script ends
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a program that creates label templates in Microsoft Word and I would like the created word document to remain open after the code runs, but it keeps getting shutdown during the python cleanup. How can I exclude Word from the cleanup?

import os, os.path
import sys

class test():
    
    def start_Word():
        os.startfile('WordFile')
        test.end()

    @staticmethod
    def end():
        sys.exit

test.start_Word()