Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Hi, and welcome back.
In this video, I'd like to show you another way to execute Python scripts, and that's using the terminal
or the command line.
This is especially useful when you connect to a remote machine or server using, for example, SSH and
run the python script on that machine.
You don't have access to a graphical environment to open python idle or pitch time to execute the script.
In fact, in this case, this is the only way to execute the script.
Let's create a Python script using any editor like Notepad or even Pixar.
You can use any other editor you like.
I'll write some Python instructions inside the script and the save it on the desktop.
Name equals.
Entry in a single coax and print.
Hello.
My name.
I'm saving the script on my desktop is my script to that PI.
This is the script.
Now I'll open cmd dot xy or a command prompt.
Go to desktop.
Check the content of the current directory by running the command.
In the run Python.
And the name of the script.
And you see how the script has been executed.
If you use Linux or Mac, open the Linux or the Mac terminal instead of CMD, ATX C and run Python three
instead of Python.
If you are not in the same directory as the Python script, you must use a valid, absolute or a relative
path.
Otherwise you'll get an error.
For example, I'm moving to the parent directory.
If I try to execute the script by running the same command.
So Python and the name of the script, I'll get an error.
That's not a valid path to the Python script.
No such file or directory.
Now I'm running the script using the correct path.
So Python, they stop with a capital D.
Slash or backslash.
You can use either of them.
And the name of the script.
My script to that pi.
Index.
Okay.
The script was run successfully.
Great.
In this lecture you've learnt how to run Python scripts directly in the terminal.
This is useful when you want to run a Python script on a machine without a graphical environment such
as a server or on a computer without PI charm or other ID installed.
Of course python should be installed on that machine.
With this video we have completed the first section of the course on set up the programming environment.
So next we are going to have a quick quiz just to make sure that you've deeply understood how to run
your Python scripts.
Good luck with the quiz and I'll see you in the next section where we'll talk about Python basics,
such as variables, comics built in data types, operators and many more.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.