Created
June 26, 2015 19:27
-
-
Save brake/fa6e779e95b3c3486f7b to your computer and use it in GitHub Desktop.
Преобразование списка файлов из параметров командной строки в список имен файлов (без расширений), разделенный запятыми.
This file contains hidden or 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
"""Преобразование списка файлов из параметров командной строки в список имен | |
файлов (без расширений), разделенный запятыми. Результат копируется в буфер | |
обмена | |
Пример: | |
было ['aaa.zip.pgp', 'bbb.zip.pgp', 'ccc.zip.pgp'] | |
стало 'aaa, bbb, ccc' | |
""" | |
from sys import argv | |
from os import path | |
from Tkinter import Tk | |
r = Tk() | |
r.withdraw() | |
r.clipboard_clear() | |
r.clipboard_append(', '.join([path.basename(n).split('.')[0] for n in argv[1:]])) | |
r.destroy() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment