def launch(): """ Instantiate a new QAplication and mainWindow classes and takes stdin input for savefile name :param app: (optional) If given, will not generate a new instance but use the one given, default is None :param win: (optional) if given, will not generate a new instance but use the one given, default is None :type app: PySide2.QtWidgets.QApplication :type app: PySide2.QtWidgets.QMainWindow """ global app try: app = QApplication(sys.argv) app.setApplicationName("partyAlignmentChartTool") app.setApplicationDisplayName("Party Alignment Chart Tool") app.setApplicationVersion("1.0.2") app.setOrganizationName("Julien Alardot") win = MainWindow(input("Savefile Name: ")) win.resize(0, 0) app.setWindowIcon(QIcon(os.path.join(PATH, "UI", "AlignmentTool.icon"))) app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()")) app.setActiveWindow(win) app.focusWindow() app.exec_() app.deleteLater() del app except Exception: tr.print_exc()
import sys from PySide2.QtWidgets import QWidget, QApplication from PySide2.QtSql import QSqlQueryModel, QSqlQuery, QSqlDatabase from mani import mani app = QApplication.instance() if app is None: app = QApplication([]) conn = QSqlDatabase.addDatabase("QOCI") conn.setDatabaseName("XE") conn.setHostName("localhost") conn.setPort(1521) conn.setUserName("user5301") # sys.path.append(r"D:\Work\Py3proj\pyqt5\lisql") # sys.path.append(r"D:\Work\Py3proj\tisql64") # import ociaccess #from getpass import getpass #passw = getpass('Please enter your password ') #conn.setPassword(passw) #passw = "p@wfnnJHJN)njb^hb,^^GHGhg;bbvcdr" mani(conn) reso = conn.open() print("Result", reso, "E", conn.lastError().text()) resc = conn.close() app.deleteLater() del conn del app input() sys.exit(0)