No module named when using PyInstaller
Had a similar problem with no module named FileDialog. Discovered that with version 3.2, I could use pyinstaller –hidden-import FileDialog … instead of modifying my main script.
Had a similar problem with no module named FileDialog. Discovered that with version 3.2, I could use pyinstaller –hidden-import FileDialog … instead of modifying my main script.
Ok, this code seems to do the trick (i.e. it puts a non-blocking ipython interpreter in a Qt widget, which can be embedded into other widgets). Keywords passed to terminal_widget get added to the namespace of the widget import atexit from IPython.zmq.ipkernel import IPKernelApp from IPython.lib.kernel import find_connection_file from IPython.frontend.qt.kernelmanager import QtKernelManager from IPython.frontend.qt.console.rich_ipython_widget import … Read more
The getOpenFileName function in PyQt4 returns a string that is the name of the selected file, and if none is selected then it returns an empty string. filename = QFileDialog.getOpenFileName(self, “Open Template”, “c:\\”, “Templates (*.xml);;All Files (*.*)”) However in PyQt5 this returns a tuple of 2 elements where the first one is a string that … Read more
Here is a working example of a separate worker thread which can send and receive signals to allow it to communicate with a GUI. I made two simple buttons, one which starts a long calculation in a separate thread, and one which immediately terminates the calculation and resets the worker thread. Forcibly terminating a thread … Read more
Here I’m using the show method. Here is a working example (derived from yours): #!/usr/bin/env python # -*- coding: utf-8 -*- from PyQt4 import QtGui, QtCore import sys class Second(QtGui.QMainWindow): def __init__(self, parent=None): super(Second, self).__init__(parent) class First(QtGui.QMainWindow): def __init__(self, parent=None): super(First, self).__init__(parent) self.pushButton = QtGui.QPushButton(“click me”) self.setCentralWidget(self.pushButton) self.pushButton.clicked.connect(self.on_pushButton_clicked) self.dialog = Second(self) def on_pushButton_clicked(self): self.dialog.show() def … Read more
Here are Windows wheel packages built by Chris Golke – Python Windows Binary packages – PyQt In the filenames cp27 means C-python version 2.7, cp35 means python 3.5, etc. Since Qt is a more complicated system with a compiled C++ codebase underlying the python interface it provides you, it can be more complex to build … Read more
By default, a QThread has an event loop that can process signals and slots. In your current implementation, you have unfortunately removed this behaviour by overriding QThread.run. If you restore it, you can get the behaviour you desire. So if you can’t override QThread.run(), how do you do threading in Qt? An alternative approach to … Read more
The issue is that you’re pickling objects defined in Settings by actually running the ‘Settings’ module, then you’re trying to unpickle the objects from the GUI module. Remember that pickle doesn’t actually store information about how a class/object is constructed, and needs access to the class when unpickling. See wiki on using Pickle for more … Read more
The problem with your program is that you are attempting to create a new QApplication with every url you fetch. Instead, only one QApplication and one WebPage should be created. The WebPage can use its loadFinished signal to create an internal loop by fetching a new url after each one has been processed. Custom html … Read more
This is just, how scoping, name lookup and closures are defined in Python. Python only introduces new bindings in namespace through assignment and through parameter lists of functions. i is therefore not actually defined in the namespace of the lambda, but in the namespace of __init__(). The name lookup for i in the lambda consequently … Read more