't Es simpel, 't es plansen, 't es Vlaams!
Run .plats files directly with Python — no compilation step needed.
Magic Mode lets you execute .plats files directly with Python's standard interpreter, just like a .py file. No need to use plats run or compile your code first.
Run .plats files like .py files
Skip the build step entirely
Just add one line to your file
Works with all Python tools
Magic Mode uses Python's PEP 263 encoding declaration and the site-packages .pth mechanism to automatically transpile and execute Platskript code.
# coding: vlaamsplats (PEP 263) and requests the corresponding codecsite module processes .pth files in site-packagesvlaamscodex_autoload.pth which registers the custom codecpip install vlaamscodex
# coding: vlaamsplats
plan doe
klap tekst gdag aan weeireld amen
gedaan
python hello.plats
That's it. No need for plats run or any build step — Python handles it automatically.
You can also use Magic Mode with a shebang for executable .plats files:
#!/usr/bin/env python
# coding: vlaamsplats
plan doe
klap tekst gdag aan weeireld amen
gedaan
chmod +x hello.plats
./hello.plats
Magic Mode works with:
python -m pdb script.platspython -m cProfile script.platspython -m coverage run script.plats.py fileMagic Mode does not work with these flags because they disable the site module:
-S / --no-site — disables the site module-I / --isolated — isolated mode restricts site-packagesIf Magic Mode is unavailable, use the standard command:
plats run script.plats
This compiles and executes your Platskript code normally.
If you get codec not found: vlaamscodex, make sure vlaamscodex is installed correctly:
pip install --force-reinstall vlaamscodex
pip install --force-reinstall vlaamscodex-S from your Python command# coding: vlaamsplats
plan doe
klap tekst gdag aan weeireld amen
gedaan
# coding: vlaamsplats
plan doe
maak funksie groet met naam doe
klap tekst gdag plakt spatie plakt da naam amen
gedaan
roep groet met tekst Piet amen
gedaan
If you run into issues with Magic Mode:
Voer .plats-bestanden rechtstreeks uit met Python — geen compilatie nodig.
Magic Mode laat u .plats-bestanden direct uitvoeren met de standaard Python-interpreter, net zoals een .py-bestand. Ge moet dus geen plats run gebruiken en ge moet ook niet eerst compileren.
Run .plats-bestanden zoals .py-bestanden
De build-stap kunt ge overslaan
Ge zet één regel bovenaan uw bestand en ’t is klaar
Werkt met alle Python-tools
Magic Mode gebruikt Python z’n PEP 263 encoding declaration en het site-packages .pth-mechanisme om Platskript automatisch te transpilen en uit te voeren.
# coding: vlaamsplats (PEP 263) en vraagt de juiste codec opsite-module de .pth-files in site-packagesvlaamscodex_autoload.pth om de custom codec te registrerenpip install vlaamscodex
# coding: vlaamsplats
plan doe
klap tekst gdag aan weeireld amen
gedaan
python hello.plats
Da’s alles. Geen plats run nodig en geen build-stap — Python regelt dat automatisch.
Ge kunt Magic Mode ook gebruiken met een shebang, zodat uw .plats-bestand uitvoerbaar wordt:
#!/usr/bin/env python
# coding: vlaamsplats
plan doe
klap tekst gdag aan weeireld amen
gedaan
chmod +x hello.plats
./hello.plats
Magic Mode werkt bijvoorbeeld met:
python -m pdb script.platspython -m cProfile script.platspython -m coverage run script.plats.py-bestand paktMagic Mode werkt niet met deze flags, omdat die de site-module uitschakelen:
-S / --no-site — schakelt de site-module uit-I / --isolated — isolated mode beperkt site-packagesAls Magic Mode niet beschikbaar is, kunt ge altijd dit gebruiken:
plats run script.plats
Dan compileert en voert Vlaams Codex uw Platskript normaal uit.
Als ge codec not found: vlaamscodex krijgt, kijk dan of vlaamscodex juist geïnstalleerd is:
pip install --force-reinstall vlaamscodex
pip install --force-reinstall vlaamscodex-S weg uit uw Python-commando# coding: vlaamsplats
plan doe
klap tekst gdag aan weeireld amen
gedaan
# coding: vlaamsplats
plan doe
maak funksie groet met naam doe
klap tekst gdag plakt spatie plakt da naam amen
gedaan
roep groet met tekst Piet amen
gedaan
Als ge problemen hebt met Magic Mode: