File: README.rst

package info (click to toggle)
python-nudatus 0.0.5-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 200 kB
  • sloc: python: 295; makefile: 50; sh: 12
file content (35 lines) | stat: -rw-r--r-- 1,087 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Nudatus
=======

Nudatus is a tool to remove comments from Python scripts.

It was created for use in uflash_ to help squeeze longer programs onto the micro:bit but it should be suitable for various environments with restricted storage.

*Note* Nudatus uses the tokenizer built into Python so only supports the syntax of the version it's running on, but it's extremely unlikely this will cause you any issues (print is handled fine).

Personally I pronounce nudatus as new-dat-us which I appreciate is probably 'wrong'.

Usage
--------

Nudatus is designed to be embedded within a greater tool (like uflash_ or Mu_ by ntoll_) but also provides a CLI tool:


.. code:: text

    nudatus [-h] [--version] [input] [output]


An input file must be specified but if output is omitted the result will be printed on stdout.

Calling from a Python script is quite simple:

.. code:: python

    import nudatus
    source = '' # Input script
    result = nudatus.mangle(source) # Result as str

.. _uflash: https://github.com/ntoll/uflash
.. _Mu: http://codewith.mu/
.. _ntoll: http://ntoll.org/