24 — Python packages: the standard library and installed libraries
Python ships with many ready-made packages. Because advanced NME is ordinary
Python, any of them is available inside a .nme file — that is the third
syntax level. The example examples/birthday.nme uses the datetime package
to count down to a birthday. Its Korean twin, examples/birthday.ko.nme, uses
Korean beginner spellings over the same calculation.
Steps
Import the part of the package you need with a Python import line:
run it →# part of examples/birthday.nme from datetime import date today = date.today() show today.yeardatenow works like any value:date(2026, 12, 25)builds a date andtoday.yearreads the year.Ask for input with beginner syntax and combine it with the package:
run it →# part of examples/birthday.nme ask month, "your birth month (1-12): " ask day, "your birth day (1-31): " today = date.today() this_year = date(today.year, int(month), int(day)) if this_year < today: this_year = date(today.year + 1, int(month), int(day)) show "your next birthday is in " + str((this_year - today).days) + " days"Run it and answer with your birth month and day:
nme run birthdayThe number changes with today's date and your answers:
your next birthday is in <number> daysOther standard packages work the same way.
statisticscan average a list,collectionscan count things, andjson(already used by theuse filemodule) reads and writes data.Third-party libraries are installed with NME's package command, a small wrapper around Python's pip. It chooses the usual Python command for your operating system and installs one package at a time:
nme install requestsThe Korean command form is equivalent:
nme 설치 requestsThe command needs internet access. If pip fails, NME reports E9025; check the package name, your connection, and that pip is installed before trying again. After a successful install, import the package the same way:
run it →import requestsAn installed package is used exactly like a standard one. Package installation is not part of this offline compiler.
Try it yourself
Change birthday.nme to count down to a favorite holiday instead of a
birthday, or print the weekday of a date with date(2026, 12, 25).strftime("%A").
What you learned
from datetime import datebrings a package name into your program.- The standard library is always available inside NME.
- Beginner
askand Python package calls mix freely on one file. nme install/nme 설치wraps pip, then third-party packages import the same way.