I am trying to send 3 arguments to pythonw program when running the progam from the CMD prompt in Windows 10. My code is:
import sys
from PyQt4.QtCore import (QTimer, Qt)
from PyQt4.QtGui import (QApplication, QLabel)
arg_no= len(sys.argv)
app = QApplication(sys.argv)
message = "%i arguments given, %i arguments after QApplication %s" % (arg_no, len(sys.argv), str(sys.argv))
label = QLabel("<font color=red size=72><b>{0}</b></font>"
.format(message))
label.setWindowFlags(Qt.SplashScreen)
label.show()
QTimer.singleShot(60000, app.quit) # 1 minute
app.exec_()
For example, when I try the following from the CMD prompt:
C:\Temp\pyqtbook26\chap04>alert.pyw 07:50 wake up now
Python is only seeing the first argument (C:\Temp\pyqtbook26\chap04>alert.pyw
), and, is not seeing the remaining three arguments (07:50 wake up now
). My instinct is that this could be some type of registry problem, but, I am not sure how to fix it?