1 00:00:00,000 --> 00:00:03,000 [Intro Music] 2 00:00:04,080 --> 00:00:06,060 We have just successfully launched 3 00:00:06,090 --> 00:00:08,490 our tiny Python application using a 4 00:00:08,490 --> 00:00:10,290 python container. And here is 5 00:00:10,290 --> 00:00:11,610 command that was used for that, 6 00:00:11,790 --> 00:00:13,680 'docker', it means that we run 7 00:00:13,680 --> 00:00:15,990 command from Docker client; 'run', we 8 00:00:15,990 --> 00:00:18,270 run specific container; '-i' 9 00:00:18,270 --> 00:00:20,310 and '-t' options tell that we 10 00:00:20,340 --> 00:00:22,590 open interactive session with pseudo-TTY 11 00:00:22,590 --> 00:00:24,570 to specific process inside of 12 00:00:24,570 --> 00:00:26,800 the container, and that is 'python3' 13 00:00:26,800 --> 00:00:28,600 process, next we map 14 00:00:28,710 --> 00:00:30,960 volume, here we use the variable 15 00:00:30,960 --> 00:00:32,820 and here inside of the container, 16 00:00:32,880 --> 00:00:34,620 we have specified that we want to 17 00:00:34,620 --> 00:00:37,740 map this volume to 'app' folder 18 00:00:37,770 --> 00:00:39,780 inside of the container. Also, we 19 00:00:39,780 --> 00:00:41,250 have specified the working 20 00:00:41,250 --> 00:00:43,230 directory inside of the container. 21 00:00:43,530 --> 00:00:46,110 Next here is image name. And 22 00:00:46,110 --> 00:00:48,510 finally, we have overridden default 23 00:00:48,510 --> 00:00:50,700 command, default command is 'python3', 24 00:00:50,700 --> 00:00:52,800 and we have told the in this 25 00:00:52,800 --> 00:00:54,990 command that we want to execute 26 00:00:55,050 --> 00:00:57,480 this file using 'python3' 27 00:00:57,480 --> 00:00:59,400 instead. And we have got the 28 00:00:59,400 --> 00:01:01,380 result. And now it's challenge 29 00:01:01,380 --> 00:01:07,170 time. It doesn't matter actually, 30 00:01:07,170 --> 00:01:08,850 whether you know Python or not, 31 00:01:08,910 --> 00:01:10,470 this challenge is very simple and 32 00:01:10,470 --> 00:01:11,910 you will be able to accomplish it 33 00:01:11,940 --> 00:01:14,520 for sure. Just do some research, 34 00:01:14,550 --> 00:01:16,230 and afterwards create custom 35 00:01:16,230 --> 00:01:17,850 application. Name of this 36 00:01:17,850 --> 00:01:19,950 application is calendar, and you 37 00:01:19,950 --> 00:01:22,080 need to create a new file inside of 38 00:01:22,080 --> 00:01:23,970 the 'python' folder with name 39 00:01:24,030 --> 00:01:27,420 'calendar-app.py'. And you will run 40 00:01:27,450 --> 00:01:29,670 this 'calendar-app.py' file 41 00:01:29,700 --> 00:01:32,190 using Python3 interpreter, same 42 00:01:32,220 --> 00:01:35,040 as we did with 'hello-world.py' file, 43 00:01:35,430 --> 00:01:36,870 it means that if I clear 44 00:01:36,870 --> 00:01:38,790 terminal, you will need to execute 45 00:01:38,820 --> 00:01:41,010 this file like so, instead of hello- 46 00:01:41,010 --> 00:01:45,270 world, will be calendar-app, and 47 00:01:45,270 --> 00:01:47,700 if you run this file, you will see 48 00:01:47,700 --> 00:01:49,560 following prompt, 'Welcome to the 49 00:01:49,560 --> 00:01:51,720 Calendar application!', and next you 50 00:01:51,720 --> 00:01:53,490 will see prompt, 'Please enter any 51 00:01:53,490 --> 00:01:56,940 year:' . Let me enter for example 2025 52 00:01:57,240 --> 00:01:59,610 like so. Next, 'Please enter any 53 00:01:59,610 --> 00:02:02,340 month number:', from 1 till 12. Let's 54 00:02:02,370 --> 00:02:05,190 enter 10. And after getting those 55 00:02:05,190 --> 00:02:07,860 two numbers from input 2025 is the 56 00:02:07,860 --> 00:02:09,900 year, and 10 is the month number; 57 00:02:10,020 --> 00:02:11,699 this program will print 58 00:02:11,699 --> 00:02:14,670 such month view, it is October 59 00:02:14,730 --> 00:02:17,640 2025 in my case. And afterwards it 60 00:02:17,640 --> 00:02:19,470 will print 'Have a nice day!', and 61 00:02:19,530 --> 00:02:21,600 terminate process. And of course 62 00:02:21,600 --> 00:02:23,190 afterwards, if I list the 63 00:02:23,190 --> 00:02:24,360 containers that are currently 64 00:02:24,360 --> 00:02:26,670 running, I will see empty output 65 00:02:26,820 --> 00:02:29,070 because this container did its job, 66 00:02:29,130 --> 00:02:31,920 and it was terminated. Small hint 67 00:02:32,070 --> 00:02:33,810 for this tiny program you will need 68 00:02:33,840 --> 00:02:35,640 to use the 'calendar' module that is 69 00:02:35,640 --> 00:02:37,320 actually built into the Python 70 00:02:37,320 --> 00:02:38,970 module. I wish you good luck, and 71 00:02:38,970 --> 00:02:40,500 next I'll give you a solution to 72 00:02:40,500 --> 00:02:42,500 this challenge. See you next. Bye-Bye. 73 00:02:42,500 --> 00:02:44,400 [no audio]