def main(): # Creates a QCoreApplication object. app = QCoreApplication(sys.argv) server = Server() print "Process ID: %i" % app.applicationPid() # Run application. app.exec_()