needmoreeasy EN 한국어
Learn

12 — Convert: turn Python into NME

★★☆☆☆ (2/5)using the tools
Prerequisites
11 — Check & Build
You will end up with
a small Python file converted into NME

nme convert goes the other way: it rewrites safe Python patterns into the level and language you choose. Lines it cannot convert safely stay Python.

Steps

  1. Create old.py with a few familiar lines:

    print("hi")
    name = input("Name: ")
    if name:
        print("hi", name)
    
  2. Convert it to English sentence syntax:

    nme convert old.py --level sentence --language en -o easy.nme
    

    The result keeps the if (Python) but rewrites what it can:

    show "hi"
    ask name "Name: "
    if name:
        print("hi", name)
    
    run it →
  3. The Korean command uses 변환; beginner syntax keeps the quotes, as the converter always does:

    nme 변환 old.py --level beginner --language ko -o easy.ko.nme
    

    The result:

    말해 "hi"
    물어봐 name, "Name: "
    if name:
        print("hi", name)
    
    run it →
  4. Check and run the converted programs:

    nme c easy
    nme run easy
    

    The converter never guesses: anything that could change the meaning stays ordinary Python.

Try it yourself

Add a for i in range(3): print(i) line to old.py and convert again at --level beginner. The loop becomes 3 times: say i — but only after you read the result.

What you learned

  • nme convert rewrites safe print, input, and simple patterns.
  • --level sentence|beginner|advanced and --language en|ko pick the target.
  • nme 변환 is the Korean command.
  • Everything uncertain stays Python — no lossy guesses.

This page on GitHub