how to execute python script

if you installed python, you can execute python script.

I will introduce how to execute python script in page.

first of all, we have to make python script to be executed.
every file of which extension is ".py" can be python script file.

so, I create "main.py" from notepad like below.



if there is python script, we can execute it easily.

first way to execute script, just double click like executing other programs. it will run if .py extension is associated with python. but, you can't see any result. because python interpreter will close the window when script is done.

therefore, if you want see anything from that, you have to execute script from window command. this is second way.

at first, open Windows command. then you can see below screen.






and then, I moved to the location in which python script is.

>cd (path)





and then, type like below.

>python main.py




we can see "hello python"




Comments

Popular posts from this blog

making menubar and menu on QML

QSizePolicy Fixed example in pyside2

let's start QML programming with PySide2