Fixeg path bug

Signed-off-by: Rémi BERTHO <remi.bertho@dalan.fr>
This commit is contained in:
Rémi BERTHO 2018-05-01 11:27:33 +02:00
parent 50030cabc1
commit 8755588310
Signed by: dalan
GPG Key ID: EE3B917931C07B64
1 changed files with 5 additions and 4 deletions

View File

@ -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()