[Tutor] sefl modifing script
chris.arndt at web.de
Tue Feb 6 18:59:08 CET 2007
Vladimir Strycek schrieb:
> Hi all,
> Is it possible to do self modifing script ? I think like variables which
> are defined in the beginning of script could be modified by it self on
> the run... like saving setting but not to external file but directly to
> it self...
While what you propose is certainly possible -- after all, a Python script is
just a file and can be therefore read and altered by Python, but for the
scenario you mention it is not the best solution. What if the script is
installed read-only? What if different users on the system where the script is
installed want different settings?
There was a thread on this list titled "The best way to implement a config file
???". I would look in this direction for a solution.
More information about the Tutor