Peter J. Holzer wrote:
> [-- text/plain, encoding quoted-printable, charset: us-ascii, 40 lines --]
>
> On 2023-12-29 09:01:24 -0800, Grant Edwards via Python-list wrote:
> > On 2023-12-28, Peter J. Holzer via Python-list
> > wrote:
> > > On 2023-12-28 05:20:07 +, rbowman via Python-list wr
On 2023-12-29 09:01:24 -0800, Grant Edwards via Python-list wrote:
> On 2023-12-28, Peter J. Holzer via Python-list wrote:
> > On 2023-12-28 05:20:07 +, rbowman via Python-list wrote:
> >> On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote:
> >> > The biggest caveat is that the shared vari
On 2023-12-28, Peter J. Holzer via Python-list wrote:
> On 2023-12-28 05:20:07 +, rbowman via Python-list wrote:
>> On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote:
>> > The biggest caveat is that the shared variable MUST exist before it can
>> > be examined or used (not surprising).
>>
First, one of the posters got it right. Nothing is REALLY ever "written"
to the file. Consider it a global variable that isn't a global variable.
Assume you have two modules, A and B. Both modules import config.
Furthermore, let's assume that Module B 'writes' a variable called "font"...
share
On 12/28/2023 12:20 AM EST rbowman via Python-list
<[1]python-list@python.org> wrote:
On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote:
The biggest caveat is that the shared variable MUST exist before it
can
be examined or used (not surprising).
On 2023-12-28 05:20:07 +, rbowman via Python-list wrote:
> On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote:
> > The biggest caveat is that the shared variable MUST exist before it can
> > be examined or used (not surprising).
>
> There are a few other questions. Let's say config.py cont
On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote:
> The biggest caveat is that the shared variable MUST exist before it can
> be examined or used (not surprising).
There are a few other questions. Let's say config.py contains a variable
like 'font' that is a user set preference or a calibr
Many years ago, Fredrik Lundh provided an answer for this question
on his website effbot.org. Unfortunately that site has gone, but luckily,
it has been preserved in the "wayback machine"...
https://web.archive.org/web/20200724053442/http://effbot.org:80/pyfaq/how-do-i-share-global-variables-acro
On 2023-12-06 07:23:51 -0500, Thomas Passin via Python-list wrote:
> On 12/6/2023 6:35 AM, Barry Scott via Python-list wrote:
> > Personally I would not use .ini style these days as the format does not
> > include type of the data.
>
> Neither does JSON.
Well, it distinguishes between some primi
On 12/6/2023 1:12 PM, MRAB via Python-list wrote:
On 2023-12-06 12:23, Thomas Passin via Python-list wrote:
On 12/6/2023 6:35 AM, Barry Scott via Python-list wrote:
On 6 Dec 2023, at 09:32, Chris Green via Python-list
wrote:
My requirement is *slightly* more complex than just key value pa
On 2023-12-06 20:11, dn via Python-list wrote:
On 7/12/23 07:12, MRAB via Python-list wrote:
On 2023-12-06 12:23, Thomas Passin via Python-list wrote:
On 12/6/2023 6:35 AM, Barry Scott via Python-list wrote:
On 6 Dec 2023, at 09:32, Chris Green via Python-list
wrote:
My requirement is *s
On 7/12/23 07:12, MRAB via Python-list wrote:
On 2023-12-06 12:23, Thomas Passin via Python-list wrote:
On 12/6/2023 6:35 AM, Barry Scott via Python-list wrote:
On 6 Dec 2023, at 09:32, Chris Green via Python-list
wrote:
My requirement is *slightly* more complex than just key value pairs,
On 2023-12-06 12:23, Thomas Passin via Python-list wrote:
On 12/6/2023 6:35 AM, Barry Scott via Python-list wrote:
On 6 Dec 2023, at 09:32, Chris Green via Python-list
wrote:
My requirement is *slightly* more complex than just key value pairs,
it has one level of hierarchy, e.g.:-
KEY
On 12/6/2023 6:35 AM, Barry Scott via Python-list wrote:
On 6 Dec 2023, at 09:32, Chris Green via Python-list
wrote:
My requirement is *slightly* more complex than just key value pairs,
it has one level of hierarchy, e.g.:-
KEY1:
a: v1
c: v3
d: v4
KEY2:
a: v
On 2023-12-06, Stefan Ram wrote:
> Chris Green writes:
>>KEY1:
>> a: v1
>> c: v3
>> d: v4
>>KEY2:
>> a: v7
>> b: v5
>> d: v6
>
> That maps nicely to two directories with three files
> (under an application-specific configuration directory).
Or an .ini fil
> On 6 Dec 2023, at 09:32, Chris Green via Python-list
> wrote:
>
> My requirement is *slightly* more complex than just key value pairs,
> it has one level of hierarchy, e.g.:-
>
>KEY1:
> a: v1
> c: v3
> d: v4
>KEY2:
> a: v7
> b: v5
> d: v6
>
> Differen
On 2023-12-06 at 09:32:02 +,
Chris Green via Python-list wrote:
> Thomas Passin wrote:
[...]
> > Just go with an .ini file. Simple, well-supported by the standard
> > library. And it gives you key/value pairs.
> >
> My requirement is *slightly* more complex than just key value pairs,
> i
Thank you everyone for all the suggestions, I now have several
possibilities to follow up. :-)
--
Chris Green
ยท
--
https://mail.python.org/mailman/listinfo/python-list
Thomas Passin wrote:
> On 12/5/2023 11:50 AM, MRAB via Python-list wrote:
> > On 2023-12-05 14:37, Chris Green via Python-list wrote:
> >> Is there a neat, pythonic way to store values which are 'sometimes'
> >> changed?
> >>
> >> My particular case at the moment is calibration values for ADC inpu
Paul Rubin wrote:
> Chris Green writes:
> > I could simply write the values to a file (or a database) and I
> > suspect that this may be the best answer but it does make retrieving
> > the values different from getting all other (nearly) constant values.
>
> I've used configparser for this, thou
On 12/5/2023 11:50 AM, MRAB via Python-list wrote:
On 2023-12-05 14:37, Chris Green via Python-list wrote:
Is there a neat, pythonic way to store values which are 'sometimes'
changed?
My particular case at the moment is calibration values for ADC inputs
which are set by running a calibration pr
Apologies: neglected suggested web.refs:
https://datagy.io/python-environment-variables/
https://pypi.org/project/json_environ/
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list
On 12/6/23 03:37, Chris Green via Python-list wrote:
Is there a neat, pythonic way to store values which are 'sometimes'
changed?
My particular case at the moment is calibration values for ADC inputs
which are set by running a calibration program and used by lots of
programs which display the va
> On 5 Dec 2023, at 14:37, Chris Green via Python-list
> wrote:
>
> Are there any Python modules aimed specifically at this sort of
> requirement?
I tend to use JSON for this type of thing.
Suggest that you use the options to pretty print the json that is saved so that
a human can read it.
On 12/5/23 07:37, Chris Green via Python-list wrote:
Is there a neat, pythonic way to store values which are 'sometimes'
changed?
My particular case at the moment is calibration values for ADC inputs
which are set by running a calibration program and used by lots of
programs which display the va
On 2023-12-05 14:37, Chris Green via Python-list wrote:
Is there a neat, pythonic way to store values which are 'sometimes'
changed?
My particular case at the moment is calibration values for ADC inputs
which are set by running a calibration program and used by lots of
programs which display the
Is there a neat, pythonic way to store values which are 'sometimes'
changed?
My particular case at the moment is calibration values for ADC inputs
which are set by running a calibration program and used by lots of
programs which display the values or do calculations with them.
From the program re
27 matches
Mail list logo