Librairy for create user interface in terminal/console with XML, CSS and Python.
from pitwi import Root, Text
(
Root(width = 45, height = 8)
.add(Text('Puf', bg='white', fg='black'))
.add(Text('Paf'), row=2, column=2)
.run()
)
<root width="45" height="8">
<style>
#pwik {
bg: white;
fg: black;
}
</style>
<text id="pwik">Puf</text>
<text row="2" column="2">Paf</text>
</root>
from pitwi import parser
parser.file('NAME_OF_YOUR_FILE.xml').run()
The text is between an opening and closing tag. <tag>text</tag>
The space in the beginning and the end are ignored.
<tag> pantoufle </tag>
== <tag>pantoufle</tag>
The character {
and }
is used to use Python code online. Is same as f-string.
<tag>{f"Pomme {{poire}} fraise"}</tag>
== <tag>Pomme {poire} fraise</tag>
The characters <
, >
is depreciated because XML not supported in text. Use escape character to use it. <tag>Puik \<puf\> paf</tag>
Press Tab
to select next element and Ctrl+Tab
to select previous element.
<root>
<style>
object {
item: color;
}
</style>
</root>
<root>
<style>
.exemple {
color: white;
fg: blue;
bg: red;
border-color: yellow;
active-border-color: cyan;
}
</style>
</root>
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- silver
- gray
- pink
- lime
- banana
- marlin
- violet
- teal
- white