Closed peacefulotter closed 9 months ago
This can easily be be done by importing compile_src
or process_file
from ts2pythonParser, e.g.
from ts2python.ts2pthonParser import process_file
...
process_file("SOURCE.ts", "DESTINATION.py")
or, use:
from ts2pthon.ts2pythonParser import compile_src, serialize_result
...
result, errors = compile_src(DOCUMENT)
if errors:
for e in errors: print(e)
else:
print(serialize_result(result))
Cool, thank you for this! Would be nice to add this to the docs unless I missed it somewhere.
Good idea, it's now in the README.
Hi,
Not sure if this is already feasible or if this can be a feature request but I would like to run
ts2python
inside a python script.Can this be achieved? If yes, how? If not, could you implement it?
Many thanks