[Python] Python: Good way to get function and all dependencies in a single file?

Discussão em 'Python' iniciado por Stack, Junho 16, 2025.

  1. Stack

    Stack Membro Participativo

    I'm working on a big Python code base that grows and grows and grows. It's not a single application - more of a bunch of experiments that share some common code.

    Every so often, I want to make a public release of a given experiment. I don't want to release my entire awful codebase, just the parts required to run a given experiment. So basically I'd like something to crawl through all the imports and copy whatever functions are called (or at least all the modules imported) into a single file, which I can release as a demo. I'd of course like to only do this for files defined in the current project (not a dependent package like numpy).

    I'm using PyCharm now, and haven't been able to find that functionality. Is there any tool that does this?

    Continue reading...

Compartilhe esta Página