All language subtitles for 005 Creating and Executing a Python Program on Windows-subtitle-en

af Afrikaans
ak Akan
sq Albanian
am Amharic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

H, again. In this video I'll show you how to create and how to run a Python program. In the previous lecture

we set up Python and we ran a Python interactive session.

So that was like a running code line by line.

But what you want to do instead, we want to write code that we are able to save it in a file and we're

able to run all the code at once.

So that's what we're going to do in this lecture.

And this is targeted to Windows users.

So if you have a Windows computer please watch this.

If you have a Mac computer or even a Linux computer please skip this video and go to the next video

where I show you the same process but on a Mac computer. So Windows users,

let's create a Python program and we're going to use very basic tools for now.

But then in the next lecture we're going to download and use an advanced editor. On Windows before creating

the program

there is something you need to make sure of. You go to organize and you go to folder search options

you go to View and then look here for this option.

Hide extensions for known file types.

You want to make sure this option is unchecked just as I have it here. Don't check it.

Cancel that and with the option unchecked you go had and right click and create create a text document.

And put a name.

Let's say my program and you want to remove the txt extension.

And want to say .py.

OK.

No problem.

I want to change the name.

Now this is a file where you're going to write your Python code.

So just go ahead and edit, edit it with an editor that you have.

Maybe Notepad.

We're going to use Atom later. For now

this is good.

And this program, what this will do, it will print out some text.

Let's say the 'Hello' text.

So that's what you do, you use the Python print function, and the print function

has this syntax.

So it expects to have some brackets opening and closing brackets.

And inside these brackets you want to pass the thing that you want to print out.

In this case this is called a string. We'll cover strings later.

Or you can say text.

So we want to print out some text and text goes inside quotes always.

So strings go, strings go inside quotes. Make sure you want to save control s, exit the script and then click

outside in here and hold shift and then right click and then you want to go to

Open command window here that you open the command prompt.

Look carefully and you'll see that the command prompt was open.

In this current directory which reflects which is actually the directory of your python file.

So this one in here. This one in here is in here.

So before you run the program you need to have these two directories the same because if you open

the command prompt from here as we did in the previous lecture that will go to another default directory.

So the best way to do it as I did it here.

Click and go to open command window here and then what you do is you type python and then the name of your

program, my program.py. So what you're doing is you're using Python, the python program to execute

this file and you get the output in the command line which is hello, the text Hello.

Similarly I could execute it with my Python 3.6, dot py and you get the same output again.

So 3.6, 3.7 doesn't make any big difference.

The differences are very very slight.

So you don't have to worry about that.

Let me execute it one more time, Python.

If you type now my and if you press the Tab key, that will autocomplete the name of your file.

So it will find the name of your file because it knows that you are in the current directory so use Tab

for auto completion and yeah, again you execute it and you get the output.

Of course you can go ahead and add other lines of code there. Let's say print 7, a number.

Numbers don't go inside quotes, control s to save and close and go to the command line again and press

the upper arrow key to execute, to call a previously executed statement.

So upper arrow key will call Python my program.py. Execute and you get

Hello

and 7. That's the idea.

Hope you enjoyed this and I'll talk to you in the next lecture.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.