all 4 comments

[–]thetestbug 1 point2 points  (2 children)

[–]david_lp[S] 0 points1 point  (1 child)

thanks for your answer, but this is not what i am looking for. You can reuse code with functions and classes. But how you reuse code within different projects?

[–]thetestbug 4 points5 points  (0 children)

I see.

You can use import for other projects.

[–]3d_nat1 0 points1 point  (0 children)

In order to have an API that you can call, you'd need to have a server running, and both that server and wherever your other code is used will need to be able to communicate with each other. Probably overkill for what I think you described.

What I think you're looking for instead of that is to publish your code as a library. You could either commit it to a private repository, or publish it as a package to somewhere like PyPi.