Mapytex/mapytex/calculus/core/__init__.py

48 lines
701 B
Python
Raw Normal View History

2018-01-21 08:26:34 +00:00
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 lafrite <lafrite@Poivre>
#
# Distributed under terms of the MIT license.
2018-09-17 14:27:08 +00:00
r"""
2018-01-21 08:26:34 +00:00
Abstracts tools for calculs manipulations
2018-09-17 14:27:08 +00:00
:example:
>>> t = Tree.from_str("2+3*4")
>>> print(t)
+
> 2
> *
| > 3
| > 4
>>> print(t.apply_on_last_level(compute))
+
> 2
> 12
>>> tree2txt(t)
'2 + 3 * 4'
>>> tree2tex(t)
'2 + 3 \\times 4'
2018-09-20 16:27:40 +00:00
>>> t = Tree.from_str("2+3x")
>>> print(t)
+
> 2
> *
| > 3
| > x
2018-09-17 14:27:08 +00:00
2018-01-21 08:26:34 +00:00
"""
2018-09-17 14:27:08 +00:00
from .tree import Tree
from .compute import compute
from .renders import tree2txt, tree2tex
2018-01-21 08:26:34 +00:00
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del