G
G
Gnifajio2022-04-16 11:16:52
Python
Gnifajio, 2022-04-16 11:16:52

Pack python?

Roughly speaking, I need to package python.
There is a script that uses the functions and classes of different modules, it is necessary that all dependencies are pulled into the main script.
For example:

# [main.py]
import a
def main(*args):
    print(b.hello)

# [a.py]
import b
def abc(*args):
    return b.somefunc(*args) + 'Hello'
hello = abc(b.c.d)

# [b.py]
import c
def somefunc(*args):
    ...

# [c.py]
d = 123

Well, something like that.
It is necessary that the output is something like this (the main thing is that it would work):
# [joined_main.py]
def main(*args):
    print(a_join_hello)
def a_join_abc(*args):
    return b_join_somefunc(*args) + 'Hello'
a_join_hello = a_join_abc(b.c.d)

def b_join_somefunc(*args):
    ...
b_join_c_join_d = 123

In general, something like webpack for js, only for python.
Maybe there is something ready, so as not to write all this?

PS: I'm reading right now, it sounds kind of stupid and strange, but this is exactly what I need.
PS(2): I don't need stuff like pyinstaller/py2exe etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexbprofit, 2022-04-16
@alexbprofit

pyinstaller or nsis

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question