Programming pages

L'Math comes built-in with a Python programming environment, perfectly suited for your MAA11 needs.


asdf

Video tutorial



Adding a programming page

Starting from L'Math 1.10, it is possible to create programming pages. On these pages, you can write Python code and execute it in a terminal-like environment.

The option to add a programming page can be found in the extra menu next to the 'Add page' button.

Elements of programming environment

  • On the left side of a programming page, you will find the code editor. Write your program code there!
  • On the right side, you will see the output and input field with a black background. There you will see the printing results of your program, and also any errors and input readings.
  • In the toolbar, you will find special programming page buttons, that you can use to run or stop the program, or to clear the result field.

Let's write our first program

Let's try out the programming page. Write or copy the code from below to the programming page's code editor, and click on 'Run program'.

print("Heippa, matikkamaailma!")

The text between the quotes should now appear on the right side:

Reading user input

Text input can be read from the user directly with Python's input() call. Then, an input field will appear on the right side with the given prompt.

Restrictions and working features

Working as expected:

  • Printing outputs and reading inputs work properly, meaning that you can print anything you want, and you can read inputs from the user.
  • Printing outputs and reading inputs work properly, i.e. time.sleep(1) will make the program sleep for a second.
  • The code and the last output are saved

Restricted or missing features:

  • Turtle or other graphical libraries do not work. This may change in the future, but for now, only text-based programs will work.
  • Files or system commands cannot be accessed from programming pages. The programming pages have their own virtual filesystem. Thus, you cannot e.g. destroy all the user's files with your code.