I have installed python3, however while running below code snippet in the VS Code terminal getting an error as system could not find the path.
This is the error am getting
Regards,
Maiya
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
import sys from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * def window(): app = QApplication(sys.argv) w = QWidget() b = QPushButton(w) b.setText( 'show message!' ) w.setWindowTitle( 'PyQt dialog demo' ) b.move( 250 , 250 ) b.clicked.connect(showdialog) w.show() sys.exit(app. exec ()) def showdialog(): msg = QMessageBox() msg.setIcon(QMessageBox.Information) msg.setText( 'This is a message box' ) msg.setInformativeText( 'This is additional information ' ) msg.setWindowTitle( 'messagebox demo' ) msg.setDetailedText( 'the details are as follows' ) msg.setStandardButtons(QMessageBox. Open | QMessageBox. Apply ) msg.buttonClicked.connect(msgbtn) retval = msg.exec_() print ( 'value of pressed message box button is: ' , retval) def msgbtn(i): print ( 'button pressed is: ' , i.text()) if __name__ = = '__main__' : window() |
Error:PS C:\Users\maiya\Desktop\test> python3 buttonapp.py
Program 'python3.exe' failed to run: The system cannot find the path specifiedAt line:1 char:1
+ python3 qthread_app.py
+ ~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ python3 qthread_app.py
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
PS C:\Users\maiya\Desktop\test>
python.exe is installed in the Quote:C:\Program Files\Python310also set the system variable path as well.
Quote:C:\Program Files\Python310\Scripts\any support on this would be really appreciated. Thanks a lot.
Regards,
Maiya