Set Windows command-line terminal title in Python

前端 未结 9 1960
攒了一身酷
攒了一身酷 2020-12-01 00:52

I\'m running several instances of a certain Python script on a Windows machine, each from a different directory and using a separate shell windows. Unfortunately Windows giv

9条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 01:26

    Since you're only going to be running this on Windows (IOW, there's not a cross-platform way to do this):

    1. Download & install the Win32 extensions for python
    2. Inside of your script, you can change the title of the console with the function

      win32console.SetConsoleTitle("My Awesome App")

提交回复
热议问题