Загрузка...

[PYTHON] Программа для работы с буфером обмена

Тема в разделе Python создана пользователем rady_inactive159273 22 фев 2020. 258 просмотров

  1. rady_inactive159273
    rady_inactive159273 Автор темы 22 фев 2020 42 19 авг 2017
    Всем здарова :cool_bun:

    Делать было нечего, а так же просто скучно, ну я и решил сделать подобный софт

    Есть 3 слота для загрузки и выгрузки какого-либо текста.
    Т.е. как бы продвинутый буфер обмена :finger_up:

    Для работы нужен сторонний модуль pyperclip:
    pip3 install pyperclip

    Код
    # -*- coding: utf-8 -*-


    # ---------------
    # ---by---rady---
    # ---------------

    from tkinter import *
    import pyperclip


    # Var
    global text1
    global text1
    global text3
    text1 = ''
    text2 = ''
    text3 = ''


    # All funct
    def bt1_past():
    global text1
    text1 = ''
    text1 = pyperclip.paste()


    def bt1_cop():
    global text1
    pyperclip.copy(text1)


    def bt2_past():
    global text2
    text2 = ''
    text2 = pyperclip.paste()


    def bt2_cop():
    global text2
    pyperclip.copy(text2)


    def bt3_past():
    global text3
    text3 = ''
    text3 = pyperclip.paste()


    def bt3_cop():
    global text3
    pyperclip.copy(text3)


    # Create windows
    win = Tk()

    # Set window color
    win['bg'] = '#292929'

    # Set window name
    win.title('ClipBoard+ by rady')

    # Set windows resolution
    win.geometry('400x60')

    # Disable resizable
    win.resizable(width=False, height=False)

    # Create buttons
    bt1_paste = Button(win, text='Save in Buffer #1', bg="#1C8254",
    fg="white", command=bt1_past)
    bt2_paste = Button(win, text='Save in Buffer #2', bg="#1C8254",
    fg="white", command=bt2_past)
    bt1_copy = Button(win, text='Unload from Buffer #1', bg="#1C8254",
    fg="white", command=bt1_cop)
    bt2_copy = Button(win, text='Unload from Buffer #2', bg="#1C8254",
    fg="white", command=bt2_cop)
    bt3_paste = Button(win, text='Save in Buffer #3', bg="#1C8254",
    fg="white", command=bt3_past)
    bt3_copy = Button(win, text='Unload from Buffer #3', bg="#1C8254",
    fg="white", command=bt3_cop)

    # Put buttons
    bt1_paste.grid(column=0, row=0)
    bt1_copy.grid(column=0, row=1)
    bt2_paste.grid(column=1, row=0)
    bt2_copy.grid(column=1, row=1)
    bt3_paste.grid(column=2, row=0)
    bt3_copy.grid(column=2, row=1)

    # Main Loop
    win.mainloop()
     
  2. httsmvkcom
    httsmvkcom 22 фев 2020 Актуальных контактов нет 1354 27 мар 2019
    Не понимаю зачем если в винде и так встроена такая дичь, но все же :finger_up:
     
  3. rady_inactive159273
    rady_inactive159273 Автор темы 22 фев 2020 42 19 авг 2017
    Что за прога? Не видел такую
     
  4. setcode
    setcode 22 фев 2020 27 10 май 2019
    В Windows 10 нажми Win + V И увидишь.
    Если ничего то нужно обновить винду..
     
  5. rady_inactive159273
    rady_inactive159273 Автор темы 22 фев 2020 42 19 авг 2017
    ахах, рил, но я не знал : )
     
Загрузка...
Top