Python error "Python NameError: global name 'Thread' is not defined"

0 votes

I have a file with python code called thread.py. I get the following error when i try to execute it:

Python NameError: global name 'Thread' is not defined

When I change the name to anything else like example1.py, it works perfectly fine. What is the problem?

May 31 in Python by Ishaan
28 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
There is a built-in function with the name thread and hence you cannot that as a filename. Change the filename to anything else and it should work.
answered May 31 by Riya

Related Questions In Python

0 votes
1 answer

Python Error saying "NameError: global name 'true' is not defined"

It's a very small mistake. Change true ...READ MORE

answered 2 days ago in Python by Vinayak
11 views
0 votes
2 answers
0 votes
0 answers

Python error saying "NameError: name 'email' is not defined"

I get the following error while executing ...READ MORE

6 days ago in Python by Kamal

edited 6 days ago 11 views
0 votes
0 answers

what is a name error in python?

why am i getting a name error ...READ MORE

Mar 7 in Python by anonymous
85 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
56 views
+4 votes
6 answers
0 votes
1 answer

Python argparse error "NameError: name 'file' is not defined"

The right datatype for destination in argpasrse module ...READ MORE

answered Nov 28, 2018 in Python by Omkar
• 66,910 points
823 views
0 votes
1 answer

Global Send Keys - Input text which has '(' is not working

Global Send Keys internally uses System.Windows.Forms.SendKeys so special characters escaped. For more ...READ MORE

answered Nov 15, 2018 in Python by findingbugs
• 3,140 points
213 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.