I
I
Igor Mikhaylov2015-04-20 17:34:57
Python
Igor Mikhaylov, 2015-04-20 17:34:57

How to dynamically update data in a variable?

Good afternoon!
I'm making a program that will display information on the main screen (not the point).
And I need to do a dynamic data update.
Well, for example:

import sysinfo
 a=sysinfo.battery()
 print(a)

I'm not really programming yet, so I write under Symbian.
UPD2: Here's my idea:
import sysinfo,time
While True:
   a=sysinfo.battery()
   print(a)
   time.sleep(10)

Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xSkyFoXx, 2015-04-20
@xSkyFoXx

You can change the value of a variable in a separate thread ( https://docs.python.org/2/library/threading.html ), much like you have a semaphore here .
PS
As Roman Kitaev rightly noted, Symbian is indeed dead .
"the Symbian platform was developed by Nokia for certain models of smartphones. It is proprietary software. The operating system was discontinued in 2012, although a slimmed-down version for basic phones was still developed until July 2014. Microsoft officially shelved the platform in favor of Windows Phone after the acquisition of Nokia." ( www.theverge.com/2014/7/17/5912289/microsoft-kills... )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question