Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why import time 2x
#1
just need a quick explanation on why if i imported time from datetime in line 2, do i need to import again in line 3 to make this work?

ctime wont appear if i dont import time on its own line... as a newbie, just a little confused


import datetime
from datetime import date, time, timedelta
import time

mtime= path.getmtime('textfile.txt')
t = time.ctime((mtime) )
print(t)
Reply


Messages In This Thread
why import time 2x - by ilcaa72 - Apr-16-2019, 04:18 PM
RE: why import time 2x - by buran - Apr-16-2019, 04:33 PM
RE: why import time 2x - by ilcaa72 - Apr-16-2019, 06:09 PM
RE: why import time 2x - by buran - Apr-16-2019, 06:23 PM
RE: why import time 2x - by DeaD_EyE - Apr-16-2019, 06:30 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020