Closed xukku closed 4 years ago
It occurs automatically.
I suggest you to create a sample module tree and run on CPython (python script.py
). It will create a folder __pycache__
containing one file ended with PYC for every imported PY file: ./X/File.py
will generate a ./X/__pycache__/File.cpython-27.pyc
, for example. This is the standard CPython behavior after Python 3.2. The Python 2.7 gets this behavior when you install the importlib2 module.
Alright. Now you run the same main script with Grumpy (grumpy script.py
). It will create a folder __pycache__
containing one FOLDER ended with PYC for every imported PY file: ./X/File.py
will generate a ./X/__pycache__/File.grumpy-XYZ.pyc
, for example.
Inside this folder will be the whole Golang source tree needed. You can go on every folder generated along the original .PY files and collect the transpiled versions.
If you want to see more internals, including every single folder generated, you can run Grumpy in debug mode: grumpy -v debug script.py
Some of this information is explained better on this link: https://labs.getninjas.com.br/released-grumpy-runtime-v0-3-0-a05f1cf8e111
in example
i have some
main file script.py
and my local module ./X/File.py