前提・実現したいこと
teratailに質問すべきかわからないのですが、一応プログラミング上の質問ということで書かせていただきます。
現在、Python3のtkinterでGUIアプリをプログラミングしています。
理想は、自分が入れたオープンソースのアプリケーションのアップデートをチェックし、もし更新のあるアプリがあるのなら、自作したアプリを操作してまとめてアップデートする、というプログラムなのですが、まずは小さく作ろうということで、LibreOfficeのアップデートを通知するプログラムを作成しようとしています。
GUIの部分に関しては、ネット上のtkinterの情報を見れば済むのですが、独学の自分だけでは、「Pythonからアプリケーションを操作し、更新の有無をチェックし、もし更新があるならアップデートしておく」という肝心な機能をどう実装していけばいいのか皆目見当がつきません。
そこで、一般的にこのような「プログラミングで任意のアプリケーションを操作する」場合、どういった方法が一般的に用いられるのか教えて頂きたいです。
自分なりにアプリを作っている先輩に聞いたのですが、win32API?というものを使っていることくらいしかわかりませんでした・・・
一応コードを貼っておきます。
Python3
1import tkinter 2from tkinter import font 3from tkinter import messagebox 4 5#実際にアップデート確認するボタン 6class Application(tkinter.Frame): 7 8 def __init__(self, master=None): 9 super().__init__(master) 10 self.pack() 11 self.create_widgets() 12 13 def create_widgets(self): 14 self.hi_there = tkinter.Button(self) 15 self.hi_there["text"] = "Check for update(LibreOffice)" 16 self.hi_there["command"] = self.say_hi 17 self.hi_there.pack(side="top") 18 19 self.quit = tkinter.Button(self, text="QUIT", command=self.master.destroy) 20 self.quit.pack(side="bottom") 21 22 def say_hi(self): 23 print("hi there, everyone!") 24 25 26root = tkinter.Tk() 27root.title("Open Source Software Project") 28root.geometry("600x400+500+150") 29 30font1 = font.Font(family="Helvatica", size=21) 31label1 = tkinter.Label(root, text="Hello", font=font1) 32label1.pack(side="top") 33 34 35def check_version(): 36 messagebox.showinfo("Version", "Version: 0.1\n") 37 38 39 40 41B1 = tkinter.Button(root, text="check version", command=check_version) 42B1.pack() 43 44status = tkinter.Label(root, text="Now processing..", borderwidth=10) 45 46status.pack(side=tkinter.BOTTOM, fill=tkinter.X) 47 48app = Application(master=root) 49app.mainloop() 50 51
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/02/06 12:51