[Tutor] just a quick logic check if someone has two seconds
nathan tech
nathan-tech at hotmail.com
Thu Aug 1 18:10:02 EDT 2019
Hi there,
I wondered if someone wouldn't mind just taking two seconds to make sure
i understand this concept:
Here is a code snippet:
import speedtest
def do-test():
test=speedtest.Speedtest()
test.download()
test.upload()
return [test.download_speed, test.upload_speed]
Now. If I was to put this into a GUI application, I was thinking of
having it something like this:
user clicks button,
button calls function which:
1. Shows the screen which updates with test status.
2, does: results=do_test()
3. Updates the screen with the contents of results.
Here's my question:
If the user clicks the button, say, 3 times, will I have three separate
speedtest objects?
or will the python garbage collector clean them up for me so I only have
one, which gets cleaned when do_test returns.
Thanks for the answer in advance.
Nathan
More information about the Tutor
mailing list