Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

Thread Safe method to change windows command prompt title in the background through python

What I'm attempting to do is create a python file, then execute it through the windows command prompt. When it runs, it should change the title of the command prompt to a different value. Currently, I use the following code segment

ctypes.windll.kernel32.SetConsoleTitleW("My New Title")

the issue with this is that if I click on a different application and the command prompt is in the background, the title will not update.

Any other methods that would fix this? Solutions should be thread-safe as well.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...