9 """Return filename with timestamp. 11 @param filename: file path. 13 @param spam: separator between timestamp and original filename. 16 >>> filname_with_timestamp("./spam/ham.txt") 17 ./spam/2015-11-14-17-42-00_ham.txt 19 head, tail = os.path.split(filename)
20 now = datetime.datetime.now()
23 format =
'%Y-%m-%d-%H-%M-%S' 25 datetime.datetime.strptime(tail[:19], format)
26 return os.path.join(head, tail)
28 return os.path.join(head, sep.join([now.strftime(format), tail]))
32 cmd =
'uc' if download
else 'open' 33 url =
'https://drive.google.com/{0}?id={1}'.format(cmd, id)
def filename_with_timestamp(filename, sep=None)
def google_drive_file_url(id, download=False)