Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How use PyQt without GUI?

Tags:

python

pyqt

pyqt4

I want create python server application using PyQt4 without GUI ( signal/slots, threads, process and other core patterns ).
How i can create this?

like image 944
rusnasonov Avatar asked Nov 19 '25 22:11

rusnasonov


1 Answers

If you need the Qt EventLoop without a GUI you can use QCoreApplication instead of QApplication: http://pyqt.sourceforge.net/Docs/PyQt4/qcoreapplication.html

From the docs:

The QCoreApplication class provides an event loop for console Qt applications.

This class is used by non-GUI applications to provide their event loop. For non-GUI application that uses Qt, there should be exactly one QCoreApplication object. For GUI applications, see QApplication.

QCoreApplication contains the main event loop, where all events from the operating system (e.g., timer and network events) and other sources are processed and dispatched. It also handles the application's initialization and finalization, as well as system-wide and application-wide settings.

like image 172
Mailerdaimon Avatar answered Nov 22 '25 11:11

Mailerdaimon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!