All right, guys, I hope that you were able to create this tiny python application yourself.
And now let me do that together with you.
I have actually created this file before, but I have removed it just.
And now let me recreate it from scratch.
Let me go to Visual Studio code and here along with Hello World file in the same python folder, I'll
create a new file calendar dash app.py.
Let me close this.
Hello world file and here let me click on Python folder and create new file.
Calendar dash App.py.
Great.
Let's first import calendar module.
It is a built into the python module.
Let me type import calendar.
And the next.
Let me print.
Text to the terminal and the text will be welcome to the calendar application.
Let me copy it from here to save time.
And let me use here single quotes like this.
And afterwards we need to get the input from the user, namely year number and month number.
For that we could use input, command input and here will be let me switch to terminal and copy this
text from here.
So please enter any year afterwards in order to reuse the number that was entered by user, we need
to assign it to some variable.
And first let's parse it using int like so and let's create a new variable, let's say year and assign
this result to that variable in the same way we need to get the month number and assign it also to the
variable.
Let's use month variable and here will be int and here will be input and let's paste here.
Input.
I'll copy it from here, like so paste here and now we have two variables that will hold the year number
and month number.
And afterwards, using this year and month, we need to call specific method of the calendar and print
result of that method to the terminal.
In order to see this month view.
Let's do that.
Let's use the print command print and here inside let's call method called month of the calendar, calendar
dot month.
And here it gets two parameters year and month.
Actually, we have reused here those two variables.
That's actually it.
And here after this line, we will get this output.
And finally, let's print this line to the terminal.
Let me copy it from here and use one more print and here will be have a nice day.
That's actually all for this tiny application.
Let's save the file.
Go to terminal and let me clear it and rerun this application with the same command as I have used in
the challenge task.
Again, we run specific container in interactive mode with dash I and dashed options.
Next comes volume mapping.
We map local folder python folder with two files into app folder inside of the container and also we
specify that we want to use that folder as working directory.
If you do so, you don't need to append here.
Prefix up before specifying file name.
And next we use Python image and override default command using this part and we simply run calendar
app.py file using python three interpreter let's press enter.
Welcome to the calendar application.
Please enter any year.
Let's say 3000.
Please enter any month.
Number 12th December and I get this result in the terminal.
That's how you are able to create this small application using Python.
I hope that you enjoyed it.
And actually that's all for this lecture and that's all for Python part.
If you want to create more complicated applications in Python, you could do that on your own.
But the main goal of those several lectures was to show you how you are able to launch Python applications
using Python containers.
I'll see you next.
And next we will try to create NodeJS application.
See you next.
Bye bye.