Search code examples
javascriptpythonpreprocessortranscrypt

Transcrypt preprocessor


I'd like a piece of advice : I would like to setup a python dev environment so that I can a maximum of code in Python and then compile it with python or by using Transcrypt. To add some more salt to this, I would like ot use some py / pyd while compiling with Python and some py / js while using Transcrypt. Thus, I think I would need a kind of preprocessor to setup a wrapper to direct the call to method of pyd or js according to the chosen compilator.

Is this preprocessing possible within python and Transcrypt ?

Do not hesitate to tell me if I am not clear.

Thanks a lot for your help


Solution

  • I wrote condiment while ago, which is a preprocessor for Python. I'm using it to embed debugging code on my side, then removing it when shipping into production.

    So yes, you could have the same source for both, and use the preprocessor to remove Python-specific parts or Transcrypt-specific parts.