A
A
anton5412021-10-25 18:46:44
Python
anton541, 2021-10-25 18:46:44

How to combine py and txt into one exe?

Good evening. I'm interested in the question: how can I use pyinstaller to put a .py and .txt file into one executable? My program reads data from this file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananchenko, 2021-10-26
@Shurik24

This is the official documentation of the module, I recommend reading
it. The documentation says that if you want to add any files to the exe, use
--add-data name.txt;flodername the name.txt
file will be stored inside the exe along the path ./flodername/name.txt
If the file you just need to put in the root folder of the exe use the dot as the folder name
--add-data name.txt;.
When creating one exe file, it makes no sense to add a txt file, it simply won’t work, only if you create a folder instead of one file in which everything will be
Here is my video with the test

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question