首页 > 解决方案 > How can i remove double quotes in cmd title

问题描述

I am writing a python game and im done with it, now i just want to add a title to the cmd window, i tried using os.sytem("title Golf Game | by Boic#8506") that didnt work as "|" is a pipeline in cmd so i changed it to os.sytem("title \"Golf Game | by Boic#8506\"") then the "|" came in the title but then my title had quotes in it which i didnt like so my question is how can i remove these quotes from my title or is there any other way to do this in python.

Also i know i should use subprocces and not os.system but i am used to it.

标签: pythoncmd

解决方案


Simply remove the inner quotes, and escape the pipe symbol (|) by using the ^ symbol:

os.system("title Golf Game ^| by Boic#8506")

推荐阅读