D
D
Dasha_PROgrammer2021-06-11 18:42:47
Python
Dasha_PROgrammer, 2021-06-11 18:42:47

How to create an exe with other libraries?

How to make an exe file a.py if it imports a function from another b.py file ?
Content of a.py file :

from b import hello_b

def qwerty():
    print('вызываем функцию из файла b')
    print(hello_b())

if __name__ == '__main__':
    qwerty()

Content of b.py file :
def hello_b():
    return "ЭТОТ HELLO В ФАЙЛЕ B"


What needs to be added in the command so that the exe of the a.py file starts without errors? I also put the b.py file in the dist
pyinstaller --onefile a.py
folder , but the script immediately crashes on startup. How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergeyfilippov4, 2021-06-11
@sergeyfilippov4

--onefileremove the parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question