Run code first time a package precompile

Hi,

Is it possible to run some code when a package precompile for the first time?
I would like to run that code just once when precompilation happen.
I don’t want to run it every time the package is loaded with using mypackage. I would like to avoid having to put my code in function __init__()

Thank you

Hmm, if you put the code in the module global scope, it will run at precompile time, and not when using it (which loads the precompiled state)

1 Like