1
00:00:03,310 --> 00:00:09,410
All right, guys, I hope that you were able to create this tiny python application yourself.

2
00:00:09,410 --> 00:00:11,630
And now let me do that together with you.

3
00:00:11,660 --> 00:00:15,350
I have actually created this file before, but I have removed it just.

4
00:00:15,350 --> 00:00:18,240
And now let me recreate it from scratch.

5
00:00:18,260 --> 00:00:25,550
Let me go to Visual Studio code and here along with Hello World file in the same python folder, I'll

6
00:00:25,550 --> 00:00:28,100
create a new file calendar dash app.py.

7
00:00:28,280 --> 00:00:29,330
Let me close this.

8
00:00:29,330 --> 00:00:34,620
Hello world file and here let me click on Python folder and create new file.

9
00:00:34,650 --> 00:00:37,730
Calendar dash App.py.

10
00:00:38,570 --> 00:00:39,200
Great.

11
00:00:39,230 --> 00:00:41,630
Let's first import calendar module.

12
00:00:41,630 --> 00:00:44,010
It is a built into the python module.

13
00:00:44,030 --> 00:00:47,270
Let me type import calendar.

14
00:00:47,980 --> 00:00:49,030
And the next.

15
00:00:49,030 --> 00:00:50,200
Let me print.

16
00:00:51,340 --> 00:00:55,960
Text to the terminal and the text will be welcome to the calendar application.

17
00:00:55,960 --> 00:00:58,510
Let me copy it from here to save time.

18
00:00:58,750 --> 00:01:02,260
And let me use here single quotes like this.

19
00:01:02,260 --> 00:01:09,700
And afterwards we need to get the input from the user, namely year number and month number.

20
00:01:09,700 --> 00:01:18,190
For that we could use input, command input and here will be let me switch to terminal and copy this

21
00:01:18,190 --> 00:01:19,360
text from here.

22
00:01:20,390 --> 00:01:26,750
So please enter any year afterwards in order to reuse the number that was entered by user, we need

23
00:01:26,750 --> 00:01:28,760
to assign it to some variable.

24
00:01:28,760 --> 00:01:37,340
And first let's parse it using int like so and let's create a new variable, let's say year and assign

25
00:01:37,340 --> 00:01:43,850
this result to that variable in the same way we need to get the month number and assign it also to the

26
00:01:43,850 --> 00:01:44,450
variable.

27
00:01:44,450 --> 00:01:51,020
Let's use month variable and here will be int and here will be input and let's paste here.

28
00:01:51,790 --> 00:01:52,530
Input.

29
00:01:52,560 --> 00:02:00,010
I'll copy it from here, like so paste here and now we have two variables that will hold the year number

30
00:02:00,010 --> 00:02:01,360
and month number.

31
00:02:01,360 --> 00:02:07,900
And afterwards, using this year and month, we need to call specific method of the calendar and print

32
00:02:07,930 --> 00:02:10,150
result of that method to the terminal.

33
00:02:10,150 --> 00:02:12,550
In order to see this month view.

34
00:02:12,550 --> 00:02:13,500
Let's do that.

35
00:02:13,510 --> 00:02:21,700
Let's use the print command print and here inside let's call method called month of the calendar, calendar

36
00:02:21,700 --> 00:02:23,110
dot month.

37
00:02:23,650 --> 00:02:29,140
And here it gets two parameters year and month.

38
00:02:29,170 --> 00:02:32,020
Actually, we have reused here those two variables.

39
00:02:32,020 --> 00:02:33,220
That's actually it.

40
00:02:33,220 --> 00:02:37,240
And here after this line, we will get this output.

41
00:02:37,240 --> 00:02:40,390
And finally, let's print this line to the terminal.

42
00:02:40,390 --> 00:02:46,720
Let me copy it from here and use one more print and here will be have a nice day.

43
00:02:46,840 --> 00:02:49,540
That's actually all for this tiny application.

44
00:02:49,540 --> 00:02:51,010
Let's save the file.

45
00:02:51,010 --> 00:02:59,390
Go to terminal and let me clear it and rerun this application with the same command as I have used in

46
00:02:59,390 --> 00:03:00,530
the challenge task.

47
00:03:00,560 --> 00:03:06,800
Again, we run specific container in interactive mode with dash I and dashed options.

48
00:03:06,830 --> 00:03:09,500
Next comes volume mapping.

49
00:03:09,500 --> 00:03:17,600
We map local folder python folder with two files into app folder inside of the container and also we

50
00:03:17,600 --> 00:03:21,200
specify that we want to use that folder as working directory.

51
00:03:21,200 --> 00:03:24,290
If you do so, you don't need to append here.

52
00:03:24,290 --> 00:03:27,380
Prefix up before specifying file name.

53
00:03:27,380 --> 00:03:35,510
And next we use Python image and override default command using this part and we simply run calendar

54
00:03:35,780 --> 00:03:40,640
app.py file using python three interpreter let's press enter.

55
00:03:41,680 --> 00:03:43,450
Welcome to the calendar application.

56
00:03:43,450 --> 00:03:44,740
Please enter any year.

57
00:03:44,770 --> 00:03:46,510
Let's say 3000.

58
00:03:46,840 --> 00:03:48,220
Please enter any month.

59
00:03:48,220 --> 00:03:52,510
Number 12th December and I get this result in the terminal.

60
00:03:52,690 --> 00:03:56,490
That's how you are able to create this small application using Python.

61
00:03:56,500 --> 00:03:57,820
I hope that you enjoyed it.

62
00:03:57,820 --> 00:04:01,890
And actually that's all for this lecture and that's all for Python part.

63
00:04:01,900 --> 00:04:06,640
If you want to create more complicated applications in Python, you could do that on your own.

64
00:04:06,640 --> 00:04:14,020
But the main goal of those several lectures was to show you how you are able to launch Python applications

65
00:04:14,020 --> 00:04:15,970
using Python containers.

66
00:04:16,110 --> 00:04:16,990
I'll see you next.

67
00:04:16,990 --> 00:04:20,680
And next we will try to create NodeJS application.

68
00:04:20,709 --> 00:04:21,519
See you next.

69
00:04:21,519 --> 00:04:22,120
Bye bye.

