Ken Starks wrote:
Ilias Lazaridis wrote:
within a python script, I like to create a collection which I fill with
values from an external text-file (user editable).
How is this accomplished the easiest way (if possible without the need
of libraries which are not part of the standard
perhapse consider using the pickle module?
http://docs.python.org/lib/module-pickle.html
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 23 Jan 2006 21:00:55 +0200, Ilias Lazaridis [EMAIL PROTECTED] wrote:
within a python script, I like to create a collection which I fill with
values from an external text-file (user editable).
How is this accomplished the easiest way (if possible without the need
of libraries which are
Seeing as we're suggesting alternatives, ConfigObj is great for hand
readable/writable data persistence.
You can use validate and ConfigPersist for automatic type conversion.
You can persist (basically) all the standard datatypes using this. The
syntax is usually more 'familiar' than Yaml, but
Ilias Lazaridis wrote:
within a python script, I like to create a collection which I fill with
values from an external text-file (user editable).
If a spreadsheet like layout fits, use the csv module and
a plain comma separated file.
Then the end user can also use e.g. Excel to edit the data.
Sure, it's just a Python module with variables in it.
I wouldn't try to teach my users Python syntax though.
not to mention the security risks
--
http://mail.python.org/mailman/listinfo/python-list
Ido Yehieli wrote:
Sure, it's just a Python module with variables in it.
I wouldn't try to teach my users Python syntax though.
not to mention the security risks
you mean all the things they can do from inside python that they
cannot do from the command line ?
/F
--
[EMAIL PROTECTED] wrote:
another approach (probably frowned upon, but it has worked for me) is
to use python syntax (a dictionary, say, or a list) and just import (or
reload) the file
this sounds good.
can I import a whole collection of instances this way?
-
(thanks for all the other
another approach (probably frowned upon, but it has worked for me) is
to use python syntax (a dictionary, say, or a list) and just import (or
reload) the file
--
http://mail.python.org/mailman/listinfo/python-list
Take a look at ConfigParser module. The format of the file would be
something like:
[members]
peter=16
anton=21
People are accustomed to this format file (windows .ini format).
-Larry
Ilias Lazaridis wrote:
within a python script, I like to create a collection which I fill with
values from
Maybe YAML is what youre looking for...
http://yaml.org
--
http://mail.python.org/mailman/listinfo/python-list
within a python script, I like to create a collection which I fill with
values from an external text-file (user editable).
How is this accomplished the easiest way (if possible without the need
of libraries which are not part of the standard distribution)?
something like:
text-file:
{peter,
Ilias Lazaridis wrote:
within a python script, I like to create a collection which I fill with
values from an external text-file (user editable).
How is this accomplished the easiest way (if possible without the need
of libraries which are not part of the standard distribution)?
13 matches
Mail list logo