Is it possible to make a "pyc only" "distribution"?
Question: Say I have a python code base organized like so:

    
    
    ./mod/:
        ./__init__.py
        ./main/main.py
        ./main/__init__.py
        ./mytest/__init__.py
    

The file

    
    
    mod/main/__init__.py
    

is empty. And

    
    
    $ cat mod/main/main.py 
        import sys
        import mytest
        def main(argv):
            mytest.test()
            return
        if __name__ == '__main__':
            sys.exit(main(sys.argv[1:]))
    

And

    
    
    $ cat mod/mytest/__init__.py 
    def test():
        print('test worked!')
    

As expected, this works (from within the directory "mod"):

    
    
    $ python3 -m main.main
    test worked!
    

Now, I want to remove all the .py files, and still be able to run the command
that I have above - or something very similar. "Very similar" is defined by
not having to change my code structure at all - or, if that cannot be done, as
little as possible.

How can I achieve this?


Answer: the

    
    
    compileall
    

utility with the "-b" option did the thing for me.

