|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
利用了pyperclip库
- import pyperclip
- def scan(string):
- if len(string) > 30:
- i = 0
- for ch in string:
- if ch == '。':
- return scan(string[0: i]) + scan(string[i + 1: len(string) - 1])
- i += 1
- print('太长了')
- return ''
- return_string = ''
- is_chinese = False
- for ch in string:
- if '\u4e00' <= ch <= '\u9fff':
- if is_chinese:
- return_string += ' '
- return_string += ch
- is_chinese = False
- elif ch == ',':
- return_string += ch
- is_chinese = False
- elif ch == '。':
- is_chinese = False
- elif is_chinese:
- return_string += ch
- else:
- return_string += ' ' + ch
- is_chinese = True
- if string[-1] == "%":
- pyperclip.copy(return_string + ' 。\n')
- elif string[-1] == "!" or string[-1] == "?" or string[-1] == "." or string[-1] == ":":
- pyperclip.copy(return_string)
- pyperclip.copy(return_string + '。\n')
- def first_title(string):
- pyperclip.copy('[align=center][size=5][b]' + string + '[/b][/size][/align]')
- def second_title(string):
- pyperclip.copy('[size=4][b]' + string + '[/b][/size]')
- def third_title(string):
- pyperclip.copy('[size=3][backcolor=DarkSlateGray][color=White]' + string + '[/color][/backcolor][/size]')
复制代码
输入完 scan(),*_title() 就可以直接到帖子里 ctrl + v 了。
精华2.0
https://fishc.com.cn/thread-216900-1-1.html
(出处: 鱼C论坛)
|
评分
-
查看全部评分
|