Fixeg path bug
Signed-off-by: Rémi BERTHO <remi.bertho@dalan.fr>
This commit is contained in:
parent
50030cabc1
commit
8755588310
1 changed files with 5 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from os import path
|
||||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
|
@ -9,10 +10,10 @@ from PyQt5.QtWidgets import *
|
||||||
from PyQt5.QtWebEngine import *
|
from PyQt5.QtWebEngine import *
|
||||||
from PyQt5.QtWebEngineWidgets import *
|
from PyQt5.QtWebEngineWidgets import *
|
||||||
|
|
||||||
path = os.path.dirname(os.path.realpath(sys.argv[0]))
|
img = path.abspath(sys.argv[1])
|
||||||
os.chdir(path)
|
|
||||||
|
|
||||||
img = sys.argv[1]
|
exe_dir = path.dirname(path.realpath(sys.argv[0]))
|
||||||
|
os.chdir(exe_dir)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open("html/index.html", "r", encoding="utf8") as file:
|
with open("html/index.html", "r", encoding="utf8") as file:
|
||||||
|
@ -25,7 +26,7 @@ app = QApplication(sys.argv)
|
||||||
app.setApplicationName("SimplePanoramaViewer")
|
app.setApplicationName("SimplePanoramaViewer")
|
||||||
|
|
||||||
web = QWebEngineView()
|
web = QWebEngineView()
|
||||||
web.setHtml(html,QUrl("file://" + path + "/index.html"))
|
web.setHtml(html,QUrl("file://" + exe_dir + "/index.html"))
|
||||||
web.setWindowTitle(img)
|
web.setWindowTitle(img)
|
||||||
web.show()
|
web.show()
|
||||||
|
|
Loading…
Reference in a new issue