tool script to convert back slash
2024-09-08 19:20:20
Back slash is used in windows, which makes so many headache for me. Then an idea came to my mind. It's
- writing a python script to modify my clipboard content, and
- creating a listary command to call the script.
steps
- create the script
D:\tool\slash_convertion.py
with following content.
import re
import clipboard
text = clipboard.paste()
lsA = text.splitlines()
lsB = []
for line in lsA:
line = re.sub(r"\\", "/", line)
theMatch = re.search("^\"*(.*?)\"*$", line)
# print(theMatch)
line = f'"{theMatch.groups()[0]}"'
lsB.append(line)
text = "\n".join(lsB)
text += "\n"
# print(text.encode("utf8"))
# print(text)
clipboard.copy(text)
- create listary command
- input keyword
slash
to modify you clipboard content.
最新文章
- 同样有缓冲区,为什么bufferedReader输入流不需要清空缓冲区?而bufferedWriter需要清空缓冲区呢?
- [推荐]WebService开发知识介绍
- 原生DOM探究 -- NodeList v.s. HTMLCollection
- SOCKET:SO_LINGER 选项
- git和svn的区别001
- 比特币钱包应用breadwallet源码
- Spark官方文档——本地编写并运行scala程序
- ArcGlobe点击IGlobeServerLayer图层读取信息
- 英特尔Intel
- DNS安全浅议、域名A记录(ANAME),MX记录,CNAME记录(转)
- Decision Boundaries for Deep Learning and other Machine Learning classifiers
- 判断richtextbox选中的是否为图片
- 分布式发布订阅消息系统 Kafka 架构设计[转]
- cf702A Maximum Increase
- Git子模块引用外部项目
- JustSoso笔记
- Linux程序宕掉后如何通过gdb查看出错信息
- TFLite基础知识
- Oracle数据csv导入
- MyBatis基础:MyBatis数据基本操作(2)