Skip to content

Instantly share code, notes, and snippets.

@TakamiChie
Created January 27, 2019 09:22
Show Gist options
  • Save TakamiChie/be9e8b78db984bd8350ae3ab1c532d32 to your computer and use it in GitHub Desktop.
Save TakamiChie/be9e8b78db984bd8350ae3ab1c532d32 to your computer and use it in GitHub Desktop.
Sentenceフォルダ配下のファイルをコピーして貼り付ける
"""
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