Skip to content

Commit 576c314

Browse files
committed
小程序:给复制的文字段落前自动加星号
1 parent 6016995 commit 576c314

File tree

7 files changed

+338
-0
lines changed

7 files changed

+338
-0
lines changed

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/pythonTool_test.iml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 267 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bulletPointAdder.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
#!/usr/bin/env python3
3+
# -*- coding: utf-8 -*-
4+
5+
6+
7+
8+
import pyperclip
9+
10+
text = pyperclip.paste()
11+
# TODO: Separate lines and add stars.
12+
13+
lines = text.split('\n')
14+
for i in range(len(lines)): # loop through all indexes in the "lines" list
15+
lines[i] = '*' + lines[i] # add star to each string in "lines" list
16+
17+
text = '\n'.join(lines)
18+
pyperclip.copy(text)
19+
mm = pyperclip.paste()
20+
#mm1 = str(mm, encoding='utf-8')
21+
22+
23+
print(mm)

pw.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#! python3
2+
# pw.py - An insecure password locker program
3+
4+
PASSWORDS = {'email': '123@123.com',
5+
'blog': 'x',
6+
'luggage': '12345'} # 定义一个字典
7+
8+
import sys, pyperclip
9+
if len(sys.argv) <2:
10+
print("Usage: py pw.py [account] - copy account password")
11+
sys.exit()
12+
13+
account = sys.argv[1] # first command line arg is the account name
14+
15+
if account in PASSWORDS:
16+
pyperclip.copy(PASSWORDS[account])
17+
print("Password for" + account + 'copied to clipboard')
18+
else:
19+
print('There is no account named' + account)

0 commit comments

Comments
 (0)