Author Topic: Multithreading python,tkinter; basic start  (Read 881 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.takniki

  • Frequent Contributor
  • **
  • Posts: 342
Multithreading python,tkinter; basic start
« on: October 31, 2015, 03:54:15 pm »
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?

Offline krish2487

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: dk
Re: Multithreading python,tkinter; basic start
« Reply #1 on: October 31, 2015, 09:40:39 pm »
No No No...

Please respond to the other threads where you have asked, received responses and did not bother replying to them.
Netiquette please.

It is only a matter of time before people stop replying altogether.

Secondly, this is not a school for learning how to code. No spoon-feeding, no hand holding.
If you need help, show, demonstrate and ask help for a particular section. Not a general critique my code.
This is a electronics forum. Wrong place to post and request help on python. You have different python forums for that.
(Not that others here don't know python, but this isn't the place)
If god made us in his image,
and we are this stupid

Offline tec5c

  • Frequent Contributor
  • **
  • Posts: 415
  • Country: au
Re: Multithreading python,tkinter; basic start
« Reply #2 on: October 31, 2015, 10:16:00 pm »
Well there's that, and the OP post is basically not even asking anything and done so in a confusing way. Numbered points? Really?

The only real question you actually asked can be answered with knowledge of your previous statements.

Better yet, go ask your questions here: as this is not a software "engineering" forum.

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo