Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100899

Re: Importing constantly changing variables

From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: Importing constantly changing variables
Date 2015-12-27 10:15 +1100
Message-ID <mailman.25.1451172008.11925.python-list@python.org> (permalink)
References <944a9d35-dc31-4074-8d56-bb6e9a0d1d15@googlegroups.com>

Show all headers | View raw


ariklapid.swim@gmail.com writes:

> Hello everyone !
> First of all, excuse me for my horrible English.

As is often the case with people who make this apology, your English is
far better than most native English speakers can use any other language
:-)

> A file named "sensors.py" imports varying values from physical
> sensors. These values are constantly changing. 

Such values, then, should not be obtained from a Python ‘import’.

Instead, you need to come up with a data transfer protocol, or (more
likely) make use of an existing one. Your running program will make
function calls that get the data from “the outside world” – a file, or a
network interface, or some other input to the program.

So to solve this you will need to know the specifics of how the device
connects to the computer, what interfaces it presents for obtaining the
data at run time, and what Python libraries you can use for accessing
that interface.

-- 
 \           “If you do not trust the source do not use this program.” |
  `\                                —Microsoft Vista security dialogue |
_o__)                                                                  |
Ben Finney

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Importing constantly changing variables ariklapid.swim@gmail.com - 2015-12-26 07:14 -0800
  Re: Importing constantly changing variables Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-26 10:11 -0700
  Re: Importing constantly changing variables Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-12-26 13:14 -0500
  Re: Importing constantly changing variables Ben Finney <ben+python@benfinney.id.au> - 2015-12-27 10:15 +1100

csiph-web