I just tried the latest transcrypt on Python 3.7 Win7 with the simple program from https://github.com/bunkahle/Transcrypt-Examples/blob/master/alerts/alerts2.py but I got an compilation error:
C:\Python37\Programme\Transcrypt>transcrypt alerts2.py
Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.7.16
Copyright (C) Geatec Engineering. License: Apache 2.0
Saving target code in: C:/Python37/Programme/Transcrypt/__target__/org.transcrypt.__runtime__.js
Saving minified target code in: C:/Python37/Programme/Transcrypt/__target__/org.transcrypt.__runtime__.js
Error while compiling (offending file last):
File 'org.transcrypt.__runtime__', line 0, namely:
[WinError 2] The system cannot find the specified file
Aborted
Any idea what went wrong? I just get a directory named __target__
which holds one file called org.transcrypt.__runtime__.pretty.js
but no alerts2.js whatsoever. BTW why did you change the __javascript__
name of the compilation directory from transcrypt 3.6 to __target__
in transcrypt 3.7?
OK, I finally found out myself what went wrong. In case you get that error most probably Java is not installed on your machine which is needed to minify the javascript code which transcrypt seems to try by default. So just invoke the command:
transcrypt -n alerts2.py
and it runs without any error because -n disables minification of the code. BTW it would be nice if transcrypt would output an error message like "Warning: No Java installed - minification is disabled. Install Java for code minification." or the like and still output the not minified code. Or even better not rely on Java at all for code minification. Should be a three liner in Python I think.