20 lines
811 B
Python
20 lines
811 B
Python
path = r'c:\NeoZQYY\apps\miniprogram\miniprogram\pages\board-finance\board-finance.wxss'
|
|
with open(path, 'r', encoding='utf-8') as f:
|
|
content = f.read()
|
|
|
|
duplicate = '\n\n/* 左列标题行:标题靠左,环比靠右 */\n.gift-col--name .gift-label-line {\n display: flex;\n width: 100%;\n justify-content: space-between;\n align-items: center;\n gap: 8rpx;\n}'
|
|
|
|
# 只保留第一次出现,去掉第二次
|
|
first = content.find(duplicate)
|
|
if first != -1:
|
|
second = content.find(duplicate, first + 1)
|
|
if second != -1:
|
|
content = content[:second] + content[second + len(duplicate):]
|
|
with open(path, 'w', encoding='utf-8') as f:
|
|
f.write(content)
|
|
print('Removed duplicate OK')
|
|
else:
|
|
print('No duplicate found')
|
|
else:
|
|
print('Pattern not found')
|