Remove unused threading module
Check __name__ variable instead of using main() function