Hi Kevin
The other posters helped you with configParser, which is what you
wanted, i.e. text file access.
However, you can also get persistance really cheaply with pickling, if
you don't need the saved data to be text-editable:
(from memory)
verboseSettings = {}
verboseSettings['Detailed'] =
Geoffrey Clements:
readfile = open('prefs').readlines()
for line in readfile:
print line
eval(line)
print Basic
Instead of using eval, using a plain dict may be a better solution.
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
I want to write some variables (user preferences, specifically) to a
text file and then read the values from that file.
Here is my code to write the data:
verbosemodes=
Detailed = -vv
Basic = -q
file = open('prefs', 'w')
file.writelines(verbosemodes)
file.close()
And here is my
Kevin Walzer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I want to write some variables (user preferences, specifically) to a
text file and then read the values from that file.
Here is my code to write the data:
verbosemodes=
Detailed = -vv
Basic = -q
file =
Kevin Walzer a écrit :
I want to write some variables (user preferences, specifically) to a
text file and then read the values from that file.
http://docs.python.org/lib/module-ConfigParser.html
--
http://mail.python.org/mailman/listinfo/python-list
On Thursday 14 December 2006 09:31, Kevin Walzer wrote:
I want to write some variables (user preferences, specifically) to a
text file and then read the values from that file.
Here is my code to write the data:
verbosemodes=
Detailed = -vv
Basic = -q
file = open('prefs',