发布时间:2019-08-25 09:36:43编辑:auto阅读(1307)
Python编程快速上手实践项目题目,欢迎指证与优化!
代码:
#! python3
# bulletPointAdder.py - Adds Wikipedia bullet points to the start
# of each line of text on the clipboard.
import pyperclip
text = pyperclip.paste()
# 从剪贴板粘贴文本
lines = text.split('\n')
# 使用 split()方法得到一个字符串的列表,以回车符分隔
for i in range(len(lines)):
lines[i] = '* ' + lines[i]
#遍历 lines 中的每个表项,在每个表项前加*
text = '\n'.join(lines)
#指定字符\n连接序列中元素后生成的新字符串
pyperclip.copy(text)
#复制新的字符串
上一篇: cocos2d-x在Lua中添加3d模型
下一篇: BGP学习 总结3
46490
44380
35829
33387
28084
24649
23572
18787
18047
16735
4555°
5113°
4644°
4784°
5447°
4410°
4463°
5009°
4903°
6149°