好的,所以我正在编写第 6 章关于自动化无聊的东西,但我无法理解如何让它运行项目。它运行,但出现的只是“按任意键继续...”。就好像我不能输入和字符串让它工作......或者至少我认为它应该是这样的。我不是最好的 pyperclip 或让事情运行。
任何人都可以帮助我了解如何让它工作,所以我可以有一些输出?我也不确定如何在 cmd 行中使用剪贴板,有什么想法吗?
#! python3
# bulletPointAdder.py - Adds Wikipedia bullet points to the start
# of each line of text on the clipboard.
import pyperclip
text = pyperclip.paste()
# Separate lines and add stars.
lines = text.split('\n')
for i in range(len(lines)): # loop through all indexes for "lines" list
lines[i] = '* ' + lines[i] # add star to each string in "lines" list
text = '\n'.join(lines)
pyperclip.copy(text)
这是我正在使用的 bin 文件:
@py C:\Users\david\MyPythonScripts\AddingBullets.py %*
@pause