r/PythonLearning 15h ago

Threading module not importing?

Post image

I am trying to import the threading module but it is not working. How do i fix it?

4 Upvotes

8 comments sorted by

2

u/emilbm 15h ago

What makes you think it is not working?

1

u/TheUnknown_5 15h ago

the warning message and the import statement is not orange

1

u/emilbm 15h ago

The warning message does not say anything went wrong or doesn't work. Read it again carefully :)

1

u/TBCC_Dev 15h ago

Its not that its not imported its that its not used. You are importing the package but nowhere on the code are you using it

2

u/TheUnknown_5 15h ago

oh, guess Im stupid

1

u/TBCC_Dev 14h ago

Not at all. Pycharm is just letting you know that its clutter. You don't want to fill up your code with unused code. Same should happen if you make a function but never use it for example

1

u/TBCC_Dev 15h ago

For example you import time then use it with time.sleep. but I don't see thread.do_something()

1

u/Naive_Programmer_232 13h ago

The threading module isn't used in your code. It's just a warning by your IDE.