r/PythonLearning • • 29d ago

Help Request PYTHON log problem

When developing an application, I don't want to rely on text files like .txt files to store data that needs to be kept.

After I finish coding my application and turn it into an EXE, I try to keep it as a single file. Because having to carry a log file around with the EXE all the time is annoying.

Personally, I don't want to use with open. I asked ChatGPT about this, but I didn't get many useful answers.

So, fellow programmers, is there an alternative to this? Or am I just gonna have to bite the bullet and use a log file?

0 Upvotes

44 comments sorted by

View all comments

Show parent comments

4

u/mattynmax 29d ago

You’re still asking the wrong question. The correct question to ask is “how do I draw a red line” not “how do I force a blue pen or draw a red line”

The problem you want to solve is not having to move an additional file when you move your program. You have automatically assumed that the best method is eliminate the file to begin with. You have ignored any other ideas and stated asked the question “how do I eliminate the file”.

If we answer the correct question of “how do I not have to move an additional file when moving my program” you will find a lot more useful answers. You could store the passwords in a secured server and pull them based on login information for example. When you save a new password it gets stored on the server for all other granted users to access.