Parser: default parser from string to special type

Parser: default parser from string to special type

Used specially for CSS

pymt.parser.parse_image(filename)

Parse a filename to load an image ro svg

pymt.parser.parse_color(text)

Parse a text color to a pymt color. Format supported are : * rgb(r, g, b) * rgba(r, g, b, a) * #aaa * #rrggbb

pymt.parser.parse_int

alias of int

pymt.parser.parse_float

alias of float

pymt.parser.parse_string(text)

Parse a string to a string (remove quotes and double-quotes)

pymt.parser.parse_bool(text)

Parse a string to a boolean

pymt.parser.parse_int2(text)

Parse a string to a integer with exactly 2 number

>>> print parse_int2("12 54")
12, 54
pymt.parser.parse_float4(text)

Parse a string to a float with exactly 4 floats

>>> parse_float4('54 87. 35 0')
54, 87., 35, 0

Previous topic

Obj: handle 3D mesh from the OBJ format file.

Next topic

Plugins: basic plugins management, used for desktop examples

This Page