Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Sex is like air. It's only a big deal if you can't get any.


devel / comp.lang.python / Re: How/where to store calibration values - written by program A, read by program B

SubjectAuthor
o Re: How/where to store calibration values - written by program A,Greg Walters

1
Re: How/where to store calibration values - written by program A, read by program B

<mailman.65.1703786622.2892.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24709&group=comp.lang.python#24709

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!paganini.bofh.team!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: greg.gre...@gmail.com (Greg Walters)
Newsgroups: comp.lang.python
Subject: Re: How/where to store calibration values - written by program A,
read by program B
Date: Thu, 28 Dec 2023 12:03:03 -0600
Lines: 50
Message-ID: <mailman.65.1703786622.2892.python-list@python.org>
References: <CACNDuY9mvzt9RrkQLLPdWTjQv6pkhe9GZyWM-vBh+ne1h5TvmA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de 2JPLxV5nHg6A/RKZ94I7yA09fHj5JrGL7CnTL+FkUquQ==
Cancel-Lock: sha1:Q/RmJzET89BdyufWh1mdY66Bujs= sha256:oSLU5L06AdV43TTVPaNDryQREOTU3w7/hqYiEx2/Px4=
Return-Path: <greg.gregwa@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=gS9dUsTT;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.027
X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'variable': 0.05;
'modules': 0.07; 'tkinter': 0.07; '(assuming': 0.09; 'check,':
0.09; 'modules.': 0.09; 'subject:, \n ': 0.09; 'updated,': 0.09;
'import': 0.15; 'memory': 0.15; 'flag': 0.16; 'furthermore,':
0.16; 'greg': 0.16; 'like\xc2\xa0': 0.16; 'modules,': 0.16;
'posters': 0.16; 'received:mail-pf1-x435.google.com': 0.16;
'right.': 0.16; 'subject:program': 0.16; 'subject:values': 0.16;
'variable,': 0.16; 'variable.': 0.16; "aren't": 0.19; 'to:addr
:python-list': 0.20; 'first,': 0.22; 'subject:How': 0.23; "isn't":
0.27; 'version.': 0.28; 'module': 0.31; 'assume': 0.32; 'same,':
0.32; 'message-id:@mail.gmail.com': 0.32; 'hold': 0.33;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'really': 0.37; "it's": 0.37; 'two': 0.39; 'list': 0.39; 'use':
0.39; 'shared': 0.39; 'wants': 0.40; 'both': 0.40; 'something':
0.40; 'should': 0.40; 'including': 0.60; 'skip:i 20': 0.62;
'limited': 0.62; 'true': 0.63; 'ever': 0.63; 'simply': 0.63;
'pass': 0.64; 'your': 0.64; 'similar': 0.65; 'now,': 0.67;
'anytime': 0.69; 'subject:read': 0.69; 'global': 0.73; '(you':
0.76; '*my': 0.84; 'bounced': 0.84; 'further,': 0.84;
'subject:where': 0.84; 'walters': 0.84; 'two.': 0.91; 'clock':
0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1703786619; x=1704391419; darn=python.org;
h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
:date:message-id:reply-to;
bh=TkBm2xNmD6iPwtsSaPoKDZpHG2cZ8Kw632QCS8vbUXw=;
b=gS9dUsTTbGMyor6UmoNGa34cSL52U2N3dkyQBO2b2KOIfv+YI0tCDwq80RriJ0tUvH
6soHqAxUMnKcGDLiwi1Jdco6SOEqZbaDyk+CzIn4CdeVEAym4eGtm4dtsTVNSoa1/bQZ
UGuQOENVCw0zLMVK1UJRJTAk14343YszioFWef12YpxZqHr1dKCXaaPcnFeRbZPlchxU
YxqtMuE7oXlzhOA+EebwRc0QRxG2Hw50Ps1waC98ypkpuQNIDeypIHofcQE6XAe45lfg
VJ2b+mIwoig5lda+49zbf5d99ymhxUdIyhW+labLXZrU59j08LR59mRCEDZr+RdsDC6/
qemg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1703786619; x=1704391419;
h=to:subject:message-id:date:from:mime-version:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=TkBm2xNmD6iPwtsSaPoKDZpHG2cZ8Kw632QCS8vbUXw=;
b=TOcpkeon6vWuELT24RAgbkZN1JfPXGuHc/VPxXLd/wnGFgjQPQAbDuSJIojQcN7mCT
s1eCwwADmzWI2J9SENyuV4IEBhjUsBjevtXKQ/55daNv+k1qcSMHkxfpokTB4UNdIP5q
TquSNluptO6LTz9zdBg7uO2fMWqlE5HVp9l819+IUzE24vLUJXfqLQuiRiKXN3COq9gA
COgeaxtH96eEw6h0aEca751sw2pR6eFV4jlgCjShH1xry1eaVFxXZDfOQe4clOAmUnY2
M8FEYLWVk/BQH16sDT5TBjcNaR9mifFIdg4Sg2YTwsAFzkcH1fwnfP1InZTnQBhEx2zH
w4oQ==
X-Gm-Message-State: AOJu0YzPAgzcXv5v7ZogovT/LwSKehootFg6AT+gpDdkI5XPvqueoipv
bvAMNVDnky8AYAzM9Qzks7uolTLo/twUDM7YvkCVJR8CHVMmmBoF
X-Google-Smtp-Source: AGHT+IEeeJrpeAGJcck0dmGwHOGXgrikTLvABVlEtg388IF0x+KOoAlmWxzbv/4Vjvl4r7VohiXCkGzvqgmKbHa7M9U=
X-Received: by 2002:a05:6a20:9383:b0:196:6556:ca8b with SMTP id
x3-20020a056a20938300b001966556ca8bmr547188pzh.118.1703786619222; Thu, 28 Dec
2023 10:03:39 -0800 (PST)
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CACNDuY9mvzt9RrkQLLPdWTjQv6pkhe9GZyWM-vBh+ne1h5TvmA@mail.gmail.com>
 by: Greg Walters - Thu, 28 Dec 2023 18:03 UTC

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"...

shared.font="TkDefaultFont"

That information is immediately available to Module A. All Module A has to
do is (assuming that it has been initialized previously) do something like
this...

myFont=shared.font

Now, myFont has the value "TkDefaultFont" in both modules A and B.

Further, let's assume that we need to pass a ttk::Theme to Module B...
Module A does a
shared.currentTheme = "clam"

Anytime Module B wants to check the value of the shared variable, it can
do...

MyCurrentTheme = shared.currentTheme.

You can also use a similar variable that will hold a flag boolean "saying"
something like

shared.UpdatedInfo = True

This can be tested at any time via any timer check, including a Tkinter
root.after type timer. If the timer is true, simply go through your list
of shared variables (You should keep them in a list just to be sure) then
they can be checked on a timed basis. Or just use ...

MyVariable=shared.VariableName anytime you need to make sure it's updated.
If the value is the same, it only wastes a few clock cycles. However if it
has been updated, then you got the latest version.

This can work for any number of modules. You aren't limited to just two.

I hope this helps.

Greg
--
*My memory check bounced*

Greg Walters

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor