前回の1ボタン仕様。ただ、1クリック目はこのアプリをアクティブにする事に使われる為、実際はダブルクリックが必要。
この現象の回避方法もネットに出ているのですが、冗長になるのでパス。
ソースここから
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
import pyautogui
class LayMain(BoxLayout):
def __init__(self,**kwargs):
super(LayMain,self).__init__(**kwargs)
self.clear_widgets()
self.orientation='horizontal'
self.b1 = Button(text='Shift del',size_hint_x=1)
self.b1.bind(on_release=self.release_bt)
self.add_widget(self.b1)
def release_bt(self, instance):
pyautogui.hotkey('alt', 'tab')
pyautogui.hotkey('shift', 'del')
pyautogui.hotkey('alt', 'tab')
class MainApp(App):
def build(self):
self.title = "mail kill"
Window.size = (100,100)
Window.always_on_top = True
layout = LayMain()
return layout
if __name__=='__main__':
MainApp().run()
ソースここまで
見ての通り、ボタンを押すと Shift+Del を押してくれるボタン。
なんでこんなもの作ったかと言うと…
本来1万件位のスパムメールを消すのに2時間以上かかっていたのですが1時間で終わりました…いや、スパム削除ソフト無いのかよ?と思うのですが、案外 Linux 用は良い物が無くてですね…とは言え、メインの Windows 機でメールを読まないのはウィルス感染を避けるためなのでこればっかりはどうにもなりませぬ。


0 件のコメント:
コメントを投稿