NanoPy is a simple and clear scripting language that both beginners and experienced users can quickly get to grips with. It is used in microcontroller projects, for example for smarthomes, educational and gaming computers or automation and robotics projects.
NanoPy masters the well-known Python style or can be programmed - even more simply, in a more compact form without colons and with fewer brackets.
Python-Style
def onDraw():
clear()
drawText(10,10, "Hello World!")
update()
Compact-Style
def onDraw
clear
drawText 10,10, "Hello World!"
update
NanoPy is simple and fast. Normally this cannot be combined on microcontrollers. One either develops efficiently in the machine-oriented languages C/C++ or simply with a dynamically typed Python language - here with the disadvantages of massively increased memory consumption and slow execution speed.
NanoPy combines the simplicity of Python with the power of machine-oriented languages.
The following example outputs “Hello World!” ten times, in Python, C/C++, and NanoPy.
Python:
for i in range(0,10):
print("Hello World!")
C/C++:
#include <iostream>
int main() {
for(int i;i<10;i++) {
std::cout << "Hello World!";
}
return 0;
}
NanoPy:
for i in 10
print "Hello World!"