1
00:00:00,690 --> 00:00:01,680
Hi and welcome back.

2
00:00:02,480 --> 00:00:08,250
In this lecture, I'll talk about Michael Python and I talk about it's written to exist, how it relates

3
00:00:08,250 --> 00:00:11,970
to Python and about some of its most important characteristics.

4
00:00:14,620 --> 00:00:21,040
Around Meet the 2014 Demián George published a new programming language for Marketplace called Macra

5
00:00:21,040 --> 00:00:21,500
Python.

6
00:00:22,420 --> 00:00:28,810
This publication was a successful completion of an ambitious Kickstarter project that began in 2013

7
00:00:29,740 --> 00:00:30,940
at the Time magazine.

8
00:00:30,950 --> 00:00:33,590
Troller programming was dominated by the seed language.

9
00:00:34,330 --> 00:00:37,750
If you are familiar with their, then you know what she looks like.

10
00:00:38,750 --> 00:00:45,950
On a microcontroller like the sea is not very difficult to learn, however, things do get more complicated

11
00:00:45,950 --> 00:00:47,150
as programs get bigger.

12
00:00:47,840 --> 00:00:54,110
As microcontrollers started becoming more and more powerful, more people started being interested in

13
00:00:54,110 --> 00:00:55,990
them and to be programming them.

14
00:00:56,480 --> 00:01:01,900
Many of them were first time programmers and this included people in all age brackets.

15
00:01:01,970 --> 00:01:09,380
So Damien wanted to create a language that would work on a microcontroller that would be much easier

16
00:01:09,380 --> 00:01:10,670
to learn and use.

17
00:01:10,670 --> 00:01:16,960
Then C he didn't want to reinvent the wheel, so he chose Python as his prototype.

18
00:01:18,020 --> 00:01:24,830
His challenge then was to create a language that can mimic Python, but that can also run on the bare

19
00:01:24,830 --> 00:01:28,310
metal of a multicultural, not without an operating system.

20
00:01:29,180 --> 00:01:31,800
And that's how Michael Python came about.

21
00:01:32,270 --> 00:01:36,380
And here's a description of the language from the Micro Python website.

22
00:01:36,380 --> 00:01:38,770
And the emphasis in both characters is mine.

23
00:01:39,410 --> 00:01:45,590
So Micro Python is a lean and efficient implementation of the Python three programming language that

24
00:01:45,590 --> 00:01:52,310
includes a small subset of the Python standard library and is optimized to run on microcontrollers and

25
00:01:52,310 --> 00:01:53,900
in constrained environments.

26
00:01:55,000 --> 00:02:01,540
Now, because Michael Python contains the word python, it is easy to become confused and think that

27
00:02:01,930 --> 00:02:05,000
Python is simply a smaller version of Python.

28
00:02:05,800 --> 00:02:12,970
It is the same confusion that I constantly see between Java and JavaScript, while Python and Market

29
00:02:12,970 --> 00:02:14,900
Python have a similar name.

30
00:02:14,920 --> 00:02:19,990
They are totally different languages with a different set of goals and implementation.

31
00:02:20,800 --> 00:02:26,950
I talk more about the differences between Python and macro python in a later lecture, but for now I

32
00:02:26,950 --> 00:02:31,480
just want to make sure that you are not confused by the similarity in the name.

33
00:02:34,630 --> 00:02:40,990
What Margaret Python has taken from Python is the language architecture, its programming philosophy

34
00:02:40,990 --> 00:02:47,230
for code readability and a huge pool of programmers that already know how to use Python.

35
00:02:48,280 --> 00:02:54,220
Python is this can quickly become micro python estás and write programs for microcontrollers.

36
00:02:54,850 --> 00:03:01,240
According to the papal popularity of programming, language indexed, Python is the most popular programming

37
00:03:01,240 --> 00:03:04,630
language in the world with a 30 percent share.

38
00:03:05,560 --> 00:03:12,340
This index is calculated based on the amount of searching that is done on Google for programming, language,

39
00:03:12,340 --> 00:03:14,100
tutorials and resources.

40
00:03:14,560 --> 00:03:22,060
And as a comparison, it's interesting to see that C C++ that is used by the boards ranks around fifth

41
00:03:22,060 --> 00:03:23,620
place in this index.

42
00:03:24,580 --> 00:03:31,540
This popularity translates to a python universe that is filled with all the documentation, libraries

43
00:03:31,540 --> 00:03:33,730
and community support you ever need.

44
00:03:34,450 --> 00:03:41,890
Micro python is as easy as Python to learn, and it follows Python tradition for excellent development

45
00:03:41,890 --> 00:03:43,740
tools and documentation.

46
00:03:44,650 --> 00:03:49,720
In this course you see me constantly browsing through the Python code.

47
00:03:49,720 --> 00:03:55,930
The documentation as well as many of the excellent libraries will be using in terms of tools.

48
00:03:55,930 --> 00:04:02,050
You have many choices in this course, in particular will be using thony, but you can also choose tools

49
00:04:02,050 --> 00:04:04,720
such as you, Pycroft, and the new ED.

50
00:04:05,800 --> 00:04:13,150
What I really like about Tony is that it's a full python, Ed, on its own merit with excellent debugging

51
00:04:13,150 --> 00:04:19,300
tools, but also that fully supports market python on the E.S.P three two, as well as other target

52
00:04:19,300 --> 00:04:22,600
boards like the Recipe Pickle and the BBC Microfit.

53
00:04:23,260 --> 00:04:28,960
Another big advantage of the macro python language is that once you learn it, you can use your skills

54
00:04:28,960 --> 00:04:31,510
across multiple hardware targets.

55
00:04:32,490 --> 00:04:37,410
At the time I'm recording this lecture, Micropayment Python has support for the original mainboard

56
00:04:37,410 --> 00:04:44,610
version one and disappears, as well as third party boards such as the SDM 32 NUCLEO and Discovery Boards,

57
00:04:44,850 --> 00:04:52,350
The Peko, the Raspberry Pi, Pekoe, the White Pine, the EPA two, six, six and three to the tiny

58
00:04:52,350 --> 00:04:53,970
Pikul and the BBC.

59
00:04:53,990 --> 00:04:57,510
Markovits, I mentioned earlier and this was just a partial list.

60
00:05:00,120 --> 00:05:07,350
Now let's take a quick tour of Michael Python's most important features, first and most important for

61
00:05:07,350 --> 00:05:13,680
anyone new to this language is that Michael Python aims to implement the Python three point four with

62
00:05:13,680 --> 00:05:17,790
a little bit of three point five standard for language and syntax.

63
00:05:18,420 --> 00:05:25,050
This simply means that anyone who already programs in Python three will be able to start programming

64
00:05:25,050 --> 00:05:26,660
in Python immediately.

65
00:05:27,880 --> 00:05:35,380
Python, three reserved keywords operators functions in the infamous white space incantation is faithfully

66
00:05:35,380 --> 00:05:37,270
implemented in micro python.

67
00:05:38,440 --> 00:05:45,520
Second, because micro python targets embedded computers and microcontrollers is not possible to implement

68
00:05:45,520 --> 00:05:49,820
the Python standard library with all of its modules and methods.

69
00:05:50,680 --> 00:05:53,950
There's simply not enough storage on ITHAKA devices for that.

70
00:05:54,820 --> 00:06:02,050
Therefore, Micro Python implements a selected subset of C Python standard library, and even that is

71
00:06:02,050 --> 00:06:04,150
implemented with emphasis in efficiency.

72
00:06:05,380 --> 00:06:12,550
Micro python versions of Python libraries have a name with the you or lowercase you the letter prefix.

73
00:06:12,550 --> 00:06:15,580
So that allows you to distinguish which is which.

74
00:06:16,060 --> 00:06:24,730
Whenever you see a micro python library with a U letter prefix, know that it's a more efficient version

75
00:06:24,730 --> 00:06:34,300
or optimized version of the original C Python Library implemented for micro Python devices for Micro

76
00:06:34,300 --> 00:06:41,820
Python has an interactive interpretive mode, also known as Reppel Rebel stands for Reidsville Print

77
00:06:41,830 --> 00:06:42,160
Loop.

78
00:06:42,970 --> 00:06:45,390
Think of it as a command line for Python.

79
00:06:45,940 --> 00:06:50,980
It can use this command line to issue Python instructions or even code blocks.

80
00:06:51,980 --> 00:06:59,030
The report will evaluate the Python code immediately, and the macro Python report is fully featured

81
00:06:59,030 --> 00:07:05,960
with the intent of the completion ability to interrupt the Iranian program with controversy to invoke

82
00:07:05,960 --> 00:07:07,910
a soft reset and so on.

83
00:07:08,690 --> 00:07:15,230
There's also a paiste mood, and you can also use the underscore variable, the stores, the output

84
00:07:15,230 --> 00:07:22,530
of the previous computation in this course of using the ruble extensively to demonstrate in test code.

85
00:07:23,950 --> 00:07:30,580
Fourth, outside of the micropayment standard library, there are countless libraries contributed by

86
00:07:30,580 --> 00:07:37,750
users and published online on repositories like GitHub and Piper, which is the Python package index,

87
00:07:38,470 --> 00:07:44,690
similar to see Python Micro Python has a simple mechanism for including external code programs.

88
00:07:45,340 --> 00:07:50,620
In this case, I'll show you how to find and use the external libraries that make it easy to integrate

89
00:07:50,620 --> 00:07:55,450
hardware components like screens and sensors to your mark of Python projects.

90
00:07:56,440 --> 00:08:04,120
Fifth, Margaret Python has the ability to access a small filesystem on the target market with a device,

91
00:08:04,930 --> 00:08:11,710
this filesystem makes it possible to store your micro python programs, supporting library files and

92
00:08:11,710 --> 00:08:19,960
arbitrary files, such as text files for storing sensor data or credentials for networks and Iot services

93
00:08:20,440 --> 00:08:22,440
or even bitmap image files.

94
00:08:22,480 --> 00:08:28,600
You want to display them on and or ality, for example, by showing you a similar example later on in

95
00:08:28,600 --> 00:08:29,260
this course.

96
00:08:30,330 --> 00:08:36,180
In this course, I have prepared several examples where I demonstrate how to use the filesystem or the

97
00:08:36,180 --> 00:08:37,110
ESB 30 to.

98
00:08:38,420 --> 00:08:45,740
And finally, the six point micro python has a single command line python tool that allows you to run

99
00:08:45,740 --> 00:08:49,490
a script or access the file system on a target device.

100
00:08:50,330 --> 00:08:52,070
This tool is called PIEBALD.

101
00:08:52,070 --> 00:08:54,620
Don't apply in this course.

102
00:08:54,830 --> 00:09:01,700
We won't be using this tool because Sony idea has built in support for micro python on a variety of

103
00:09:01,700 --> 00:09:04,470
target devices, including the ESB three two.

104
00:09:05,150 --> 00:09:10,190
However, I wanted to mention piebald that we are here because it is something useful for you to be

105
00:09:10,190 --> 00:09:10,940
aware of.

106
00:09:12,070 --> 00:09:17,290
Let's talk about market python on a variety of hardware targets now, as you probably already know,

107
00:09:17,290 --> 00:09:24,700
micro python works on many different microcontrollers, and diversity of the hardware means that not

108
00:09:24,700 --> 00:09:29,800
all micro python code will work across those devices without modifications.

109
00:09:30,760 --> 00:09:37,120
In general, there are two points to remember in relation to Shery micro python code across different

110
00:09:37,120 --> 00:09:37,630
targets.

111
00:09:38,290 --> 00:09:46,150
One, most of the code that uses micro python standard library functions and the core of a language

112
00:09:46,180 --> 00:09:48,880
will work without any modifications.

113
00:09:49,810 --> 00:09:56,110
Language, syntax, reserve key words, control structures and functions that come from these standard

114
00:09:56,110 --> 00:09:58,450
libraries such as math for mathematics.

115
00:09:58,630 --> 00:10:06,940
YIVO is for basic operating system services and use time for time and date related functions will work

116
00:10:06,940 --> 00:10:09,810
across all micro python hardware targets.

117
00:10:10,030 --> 00:10:12,610
Nothing to worry about to throw.

118
00:10:12,760 --> 00:10:19,570
On the other hand, any functionality that is uniquely implemented on a market controller requires a

119
00:10:19,570 --> 00:10:22,520
unique implementation in micro python.

120
00:10:23,290 --> 00:10:29,560
For example, the way the digital pen functionality is implemented on a device like the E.S.P 32 is

121
00:10:29,560 --> 00:10:33,430
different to the implementation on a Raspberry Pi.

122
00:10:34,780 --> 00:10:40,750
There are things that Raspberry Pi pickle pens can do, for example, that E.S.P 32 can do.

123
00:10:41,860 --> 00:10:50,560
And it's a similar case for how functions relating to network interfaces is Quixey and Spart interfaces,

124
00:10:51,130 --> 00:10:55,220
analog digital converters and so on are implemented across boards.

125
00:10:55,900 --> 00:11:00,910
These differences are reflected in the micro python implementation for each board.

126
00:11:01,360 --> 00:11:08,140
And for this reason, in addition to the standard, the Library Micro Python has libraries specifically

127
00:11:08,140 --> 00:11:11,010
implemented for each supported board.

128
00:11:11,710 --> 00:11:18,070
You should take a bit of time to study your target device special libraries so that you know what is

129
00:11:18,070 --> 00:11:19,420
available and what isn't.

130
00:11:19,420 --> 00:11:25,450
And therefore you can go about taking advantage of the specific capabilities of the device that you

131
00:11:25,450 --> 00:11:26,130
have chosen.

132
00:11:26,830 --> 00:11:34,570
And one more thing, when I'm talking about this, not old device capabilities can be accessed through

133
00:11:34,570 --> 00:11:41,220
micro python, for example, in the E.S.P 32 Micron Python firmware.

134
00:11:41,560 --> 00:11:43,660
There is no support for Bluetooth.

135
00:11:43,660 --> 00:11:48,760
There is no Bluetooth module, even though, as you know, the ability to has Bluetooth capability.

136
00:11:49,330 --> 00:11:51,310
But there is support for Wi-Fi.

137
00:11:51,310 --> 00:11:58,030
And it's just one example of a capability that you won't be able to use using micro python.

138
00:12:00,520 --> 00:12:07,900
OK, now let's wrap up this lecture by going back to Michael Python's most important attribute, Michael

139
00:12:07,900 --> 00:12:11,320
Python, like Python, is designed to be readable.

140
00:12:11,950 --> 00:12:14,210
It almost reads like natural language.

141
00:12:14,230 --> 00:12:19,750
And here you can see an example of a segment of a code that I extracted from one of the lectures that

142
00:12:19,750 --> 00:12:22,210
are coming up later on in this cause.

143
00:12:23,050 --> 00:12:29,800
Even if you've never seen my cat Python written before, perhaps you never even programmed before.

144
00:12:30,160 --> 00:12:36,280
You may be able you should be able actually to understand kind of what this code segment is doing.

145
00:12:36,310 --> 00:12:40,250
You can make inferences about what this code segment is supposed to do.

146
00:12:40,930 --> 00:12:44,270
You do need to have a basic understanding of electronics.

147
00:12:44,270 --> 00:12:50,550
So, for example, keywords like pin that out and pin dot pull up may not make much sense.

148
00:12:51,010 --> 00:12:55,940
However, the language barrier to entry for micro python is minimal.

149
00:12:56,010 --> 00:13:01,360
Essentially, it's much lower than the barrier to entry for a language like C or C++.

150
00:13:01,930 --> 00:13:09,040
And this is the number one reason why Python became so popular and why Michael Python has been gaining

151
00:13:09,040 --> 00:13:13,780
massive support in popularity since the Kickstarter campaign in 2014.

152
00:13:14,800 --> 00:13:15,510
All right.

153
00:13:15,970 --> 00:13:16,930
It's about it.

154
00:13:16,930 --> 00:13:22,980
With this lecture and in the next few lectures of this first section of the course, I've covered a

155
00:13:23,020 --> 00:13:28,660
few housekeeping topics, including the software and hardware requirements and how to make the most

156
00:13:28,660 --> 00:13:35,380
out of this course to please do take the time to watch these lectures before continuing to Section two,

157
00:13:35,740 --> 00:13:37,810
which focuses a python.
