備忘録かつ添削をお願いしたく。
パッケージ化しないアプリでも、アップデートする仕組みを入れておかないと、修正する度にそれぞれのマシンでコピーする作業が起こってしまう事に気が付きました。
http経由でダウンロードする事も、zipファイルを展開することも簡単にできてしまうのだから、それを組み合わせてアプリケーションディレクトリのの .py ファイルを更新してやればよいのでは?ということで、当該の部分はこのようになりました。
def updateDownloadQuit(self):
url ="http://〜〜"
title = './update.zip'
urllib.request.urlretrieve(url,"{0}".format(title))
QMessageBox.information(None, "Info", "アプリケーションを更新して、終了します")
with zipfile.ZipFile('update.zip') as existing_zip:
existing_zip.extractall('.')
MainWindow.close()
Qtでなくても、ちょっとしたスクリプト群の配布に使えると思います。