#! python3
import pyperclip
text = pyperclip.paste()
lines=text.split('\n') #split把字符串变成列表,按\n分割
for i in range(len(lines)):
lines[i]= '*' + lines[i]
text = '\n'.join(lines) #join将列表变成字符串,并用\n连接
pyperclip.copy(text)
使用方法:
1.复制以下内容:
Lists of animals
Lists of aquarium life
Lists of biologists by author abbreviation
Lists of cultivars
2.运行程序
3.直接粘贴即可得到以下内容:
*Lists of animals
*Lists of aquarium life
*Lists of biologists by author abbreviation
*Lists of cultivars