python - 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.
解决方案
Simply remove the inner quotes, and escape the pipe symbol (|) by using the ^
symbol:
os.system("title Golf Game ^| by Boic#8506")
推荐阅读
- java - 如何在 actionListener(actionEvent e) 中声明 JLabels 以便在单击 JButton 时设置 Text
- c# - 控制台将希腊字符显示为“?” C#
- aws-amplify-sdk-android - 为具有复杂对象的 android 实现放大数据存储
- javascript - react-spring 如何使用动画(组件)
- php - 获取 Google Analytics API 令牌/Google_Client getAccessToken 返回 null/空
- django - Django:如何生成唯一的订单 ID
- c# - 无法从远程服务器下载事件日志
- r - 带有用户定义函数的 calctest(x[1:5]) 中的 raster::calc() 错误
- r - R中的堆叠条形图用于头对头统计
- python - 是否可以自动合并本体,以便将精确匹配合并到一个首选术语下?