What are the differences between using a . txt and . bat file in python?

Asked

Viewed 62 times

-2

I am looking for practical and simple ways to save information in a separate file, that even after the closing of the program.py (in python) the information is not lost. And there was a question, what are the advantages of using a file of type . txt and type . bat to store and/or read information? Is there any difference?

  • 1

    Use a structured format, like json, of this will be able to structure your data, facilitating a query later.

1 answer

1


There’s not much difference, I’d say.

Especially in this context, I understand, create a log for your python code. That’s right?

Anyway, in essence, the file would not even need to have extension, since it is to contain only unformatted text.

Of course if it is a log for some other purpose, perhaps a more known extension has more practicality, but in short: whatever.

  • The idea is similar to the log, but thanks for the reply.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.