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.