Loading...

Compile all python programmes in current directory

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

I have to write some lightweight python programmes for rhel. I was wandering how to compile all python source files (*.py) in a my source directory.

On the console just call the module py_compile and put the asterisk for the list of files to compile

python -m py_compile *.py