Multithreading python,tkinter; basic start

Discussion in 'Programmer's Corner' started by Vindhyachal Takniki, Oct 31, 2015.

  1. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    I have made a python code & using multithreading in it. this is very basic code, not using queues & other stuff.
    Code has three files:main,analog,screen. Files are attached.
    1. Main code just make three threads.
    2. has two analog sensor connected. (right now I have only connected randint to generate values, otehrwise analog sensor will be connected).
    one sensor update every 1 sec & other every 10 seconds.
    3. has tkinter function. It keeps on self updating every 100msec. Whenever valid value comes in analog sensor it prints.
    Check update_reading function in App class.

    4. I want to know if its correct way to do, at very basic level.
    Code is working fine, I have checked.
    5. I will connect other sensor also, whose values will update in every 500msec or 2 sec & so on.

    6. One additional query: update_reading function in App class, calls every 100msec. What if this function takes itself more than 100msec. What will happen then?