diff --git a/main.py b/SimplePanoramaViewer similarity index 77% rename from main.py rename to SimplePanoramaViewer index a2718ab..42accae 100755 --- a/main.py +++ b/SimplePanoramaViewer @@ -2,6 +2,7 @@ import os import sys +from os import path from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import * from PyQt5.QtGui import * @@ -9,10 +10,10 @@ from PyQt5.QtWidgets import * from PyQt5.QtWebEngine import * from PyQt5.QtWebEngineWidgets import * -path = os.path.dirname(os.path.realpath(sys.argv[0])) -os.chdir(path) +img = path.abspath(sys.argv[1]) -img = sys.argv[1] +exe_dir = path.dirname(path.realpath(sys.argv[0])) +os.chdir(exe_dir) try: with open("html/index.html", "r", encoding="utf8") as file: @@ -25,7 +26,7 @@ app = QApplication(sys.argv) app.setApplicationName("SimplePanoramaViewer") web = QWebEngineView() -web.setHtml(html,QUrl("file://" + path + "/index.html")) +web.setHtml(html,QUrl("file://" + exe_dir + "/index.html")) web.setWindowTitle(img) web.show()