Created
February 5, 2020 12:32
-
-
Save lokeshh/3387d32957dc9579a2aa9976e500fe20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
class BmiData: | |
def __init__(self): | |
self.weight = 0 | |
self.height = 0 | |
def main(bmiData): | |
for i in range(100): | |
bmiData.height += 1 | |
time.sleep(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from bmi_cal import * | |
import threading | |
bmiData = BmiData() | |
threading.Thread(target=main, args=(bmiData,)).start() | |
while True: | |
print(f"Weight = {bmiData.weight}, height = {bmiData.height}") | |
time.sleep(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment