Python: Best practice for including a version number in an app?
Posted
by
Ben
on Stack Overflow
See other posts from Stack Overflow
or by Ben
Published on 2010-12-26T23:43:24Z
Indexed on
2010/12/26
23:54 UTC
Read the original article
Hit count: 192
I have a PyQt application that reads and writes data files. I am including a 'version number' in each file written. This is a simple number similar to: 1.2 or something (major and minor versions).
I am doing this so that I can change the format of these data files in future versions and then still correctly parse them simply by checking to see what the version is inside the file.
My question is what is the best practice for keeping this number stored inside the app itself. I.e. do I just hard-code the app version number into the class that is responsible for reading and writing files? Or should I have some sort of object/variable stored at the top-level of the app and somehow access it from the class responsible for reading and writing these files. If the latter, how do I store it and how do I access it?
Thanks.
© Stack Overflow or respective owner