发布时间:2019-08-25 09:36:43编辑:auto阅读(2020)
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
51596
51185
41687
38450
32935
29922
28627
23592
23523
21869
2027°
2741°
2287°
2215°
2693°
2242°
2989°
4931°
4784°
3405°