Can the program modify itself?

Is there a way when you first start the program gathered in the exe (or even ordinary .py), override the variables inside it?
That is, suppose we have a default variable in the program, os = 'Operating System' when you first start on overridden by os = 'Windows x64', for example. Continue for all subsequent runs took on new meaning.
June 3rd 19 at 21:04
1 answer
June 3rd 19 at 21:06
Is.
But that's silly, there are better ways.
For the desktop - configuration files inside the local usersmay the applications folder.
For phone - tools SDK.
To web storage (DBMS)

Find more questions by tags Python