Importing a time module twice

I saw the code from Youtube and asked a question.

The code below imports time twice.

  • import time
  • from mktime import time

 import pandas as pd import os import time from datetime import datetime from time import mktime 

When importing time in the third row, I think the 5th row is useless.

Why does he import time twice?

+5
source share
1 answer

Why does he import time twice?

He does not do that. It copies time.mktime to mktime . He does not need, he just does it for convenience.

+6
source

Source: https://habr.com/ru/post/1239287/


All Articles