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
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 ?
--
http://mai
>>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
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.
Ido Yehieli wrote:
> perhapse consider using the pickle module?
> http://docs.python.org/lib/module-pickle.html
User editable? We should be kind to our users!
>>> d = {'peter':14, 'paul':23}
>>> pickle.dumps(d)
"(dp0\nS'paul'\np1\nI23\nsS'peter'\np2\nI14\ns."
--
http://mail.python.org/mailman/
Ilias Lazaridis wrote:
> [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 th
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 it
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 whic
perhapse consider using the pickle module?
http://docs.python.org/lib/module-pickle.html
--
http://mail.python.org/mailman/listinfo/python-list
[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 a
Maybe YAML is what youre looking for...
http://yaml.org
--
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 fro
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
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)?
>
> so
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)?
>
> s
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, 16
16 matches
Mail list logo