发布时间:2019-08-25 09:36:43编辑:auto阅读(2103)
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
51989
51817
42076
38924
33423
30378
29019
24037
23956
22307
16°
50°
67°
67°
90°
518°
2692°
3402°
2804°
2798°