Created
January 27, 2019 09:22
-
-
Save TakamiChie/be9e8b78db984bd8350ae3ab1c532d32 to your computer and use it in GitHub Desktop.
Sentenceフォルダ配下のファイルをコピーして貼り付ける
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Sentenceフォルダ配下のファイルをコピーして貼り付ける | |
uwstyle, pyperclipモジュールのインストールが必要 | |
`pip install uwstyle, pyperclip` | |
# Clipboard-Historyで使う場合の例 | |
センテンスフォルダ(&S) || Run | C:\Users\TakamiChie\AppData\Local\Packages\6432853C62D86.ClipboardHistory_mmq3pnrvshaxt\LocalCache\Roaming\ClipboardHistory\choosesentence.py | I O | |
""" | |
from uwstyle.dialogs import select | |
from pathlib import Path | |
import pyperclip | |
r = select("ファイルを選択", list(Path("Sentence").iterdir())) | |
if r[0]: | |
with open(Path(__file__).parent / r[1], mode="r",encoding="utf-8") as f: | |
t = f.read() | |
pyperclip.copy(t) | |
print(t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment