Search code examples
pythonwindowsterminalwindows-terminal

Make a python file run on the new "windows terminal" by default (Windows)


I would like to make my python file open on the "Windows Terminal" program instead of the python application that is opened by default. Is there a way to do this?


Solution

  • Use OS

    import os
    
    os.system("start cmd.exe /k python yourfile.py")