'commit'
This commit is contained in:
8
VsCode配置/Other/.idea/.gitignore
generated
vendored
Normal file
8
VsCode配置/Other/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
8
VsCode配置/Other/.idea/Other.iml
generated
Normal file
8
VsCode配置/Other/.idea/Other.iml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
6
VsCode配置/Other/.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
6
VsCode配置/Other/.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
4
VsCode配置/Other/.idea/misc.xml
generated
Normal file
4
VsCode配置/Other/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
8
VsCode配置/Other/.idea/modules.xml
generated
Normal file
8
VsCode配置/Other/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/Other.iml" filepath="$PROJECT_DIR$/.idea/Other.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
VsCode配置/Other/.idea/vcs.xml
generated
Normal file
6
VsCode配置/Other/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
26
VsCode配置/Other/SyncConfig.py
Normal file
26
VsCode配置/Other/SyncConfig.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
sourcePath = 'D:\\python\\TangDou\\AcWing'
|
||||
targetPath = 'D:\\python\\TangDou'
|
||||
listDir = os.listdir(targetPath) # 获取当前目录下的所有内容
|
||||
|
||||
fmt = "\\.clang-format"
|
||||
vscd = "\\.vscode"
|
||||
|
||||
for x in listDir:
|
||||
fName = os.path.join(targetPath, x)
|
||||
if os.path.isdir(fName) and fName != sourcePath:
|
||||
# 拷贝文件和一个子目录到目标目录下
|
||||
ta = fName + fmt
|
||||
if os.path.exists(ta):
|
||||
os.remove(ta)
|
||||
shutil.copy(sourcePath + fmt, ta)
|
||||
|
||||
tb = fName + vscd
|
||||
if os.path.exists(tb):
|
||||
shutil.rmtree(tb)
|
||||
shutil.copytree(sourcePath + vscd, tb)
|
||||
|
||||
print("成功拷贝完成:" + fName)
|
||||
print("恭喜,配置文件同步到所有工作目录!")
|
||||
33
VsCode配置/Other/WatchClip.py
Normal file
33
VsCode配置/Other/WatchClip.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
|
||||
# pip3 install install pyperclip
|
||||
sys.path.append(os.path.abspath("SO_site-packages"))
|
||||
import pyperclip # 引入模块
|
||||
|
||||
recent_value = ""
|
||||
tmp_value = "" # 初始化(应该也可以没有这一行,感觉意义不大。但是对recent_value的初始化是必须的)
|
||||
|
||||
while True:
|
||||
tmp_value = pyperclip.paste() # 读取剪切板复制的内容
|
||||
if tmp_value != recent_value: # 如果检测到剪切板内容有改动,那么就进入文本的修改
|
||||
recent_value = tmp_value
|
||||
lines = recent_value.split('\r\n')
|
||||
changed = "\"Title\":{\"prefix\":\"ActionName\",\"body\": ["
|
||||
cnt=0
|
||||
for line in lines:
|
||||
line = line.replace('"', '\\"')
|
||||
line = '"' + line + '"'
|
||||
cnt=cnt+1
|
||||
if cnt>1:
|
||||
changed = changed + ',\r\n' + line # 将文本的换行符去掉,变成一个空格
|
||||
else:
|
||||
changed = changed + '\r\n' + line # 将文本的换行符去掉,变成一个空格
|
||||
|
||||
changed =changed+"]},"
|
||||
recent_value = changed
|
||||
pyperclip.copy(changed) # 将修改后的文本写入系统剪切板中
|
||||
print("\n Value changed: %s" % str(changed)) # 输出已经去除换行符的文本
|
||||
time.sleep(0.1)
|
||||
53
VsCode配置/Other/WatchClipChangeLatex.py
Normal file
53
VsCode配置/Other/WatchClipChangeLatex.py
Normal file
@@ -0,0 +1,53 @@
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
|
||||
# pip3 install install pyperclip
|
||||
sys.path.append(os.path.abspath("SO_site-packages"))
|
||||
import pyperclip # 引入模块
|
||||
|
||||
recent_value = ""
|
||||
tmp_value = "" # 初始化(应该也可以没有这一行,感觉意义不大。但是对recent_value的初始化是必须的)
|
||||
|
||||
|
||||
def add_dollars(text):
|
||||
pattern = r'(?<!\$)\b([a-zA-Z0-9.+*/-]+)\b(?!\$)'
|
||||
replace_text = r'$\1$'
|
||||
result = re.sub(pattern, replace_text, text)
|
||||
return result
|
||||
|
||||
|
||||
while True:
|
||||
tmp_value = pyperclip.paste() # 读取剪切板复制的内容
|
||||
if tmp_value != recent_value: # 如果检测到剪切板内容有改动,那么就进入文本的修改
|
||||
recent_value = tmp_value
|
||||
lines = recent_value.split('\n')
|
||||
changed = "### 一、题目描述\n"
|
||||
flag = False
|
||||
for line in lines:
|
||||
if not flag:
|
||||
line = add_dollars(line)
|
||||
line = line.replace("$\r", "$")
|
||||
line = line.replace("$\n", "$")
|
||||
if "输入样例" in line:
|
||||
flag = True
|
||||
line = line.replace("输入格式", "**输入格式**")
|
||||
line = line.replace("输出格式", "**输出格式**")
|
||||
line = line.replace("数据范围", "**数据范围**")
|
||||
|
||||
if "输入样例" in line:
|
||||
line = "\r\n\r\n" + line.replace("输入样例", "**输入样例**")
|
||||
line = line + "\r\n" + "```cpp {.line-numbers}\r\n"
|
||||
|
||||
if "输出样例" in line:
|
||||
line = "```\r\n" + line.replace("输出样例", "**输出样例**")
|
||||
line = line + "\r\n" + "```cpp {.line-numbers}\r\n"
|
||||
|
||||
changed = changed + line
|
||||
|
||||
changed = changed + "\n" + "```"
|
||||
recent_value = changed
|
||||
pyperclip.copy(changed) # 将修改后的文本写入系统剪切板中
|
||||
print("\n Value changed: %s" % str(changed)) # 输出已经去除换行符的文本
|
||||
time.sleep(0.1)
|
||||
1
VsCode配置/Other/执行.cmd
Normal file
1
VsCode配置/Other/执行.cmd
Normal file
@@ -0,0 +1 @@
|
||||
python ./WatchClip.py
|
||||
2
VsCode配置/Other/步骤.txt
Normal file
2
VsCode配置/Other/步骤.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
pip3 install install pyperclip -i https://pypi.douban.com/simple/
|
||||
python -m pip install --upgrade pip -i https://pypi.douban.com/simple/
|
||||
Reference in New Issue
Block a user