-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilename.py
39 lines (30 loc) · 1.23 KB
/
filename.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from datetime import datetime, time
import os
def Fpath(path):
date_time = datetime.now()
flname = str(date_time.year) + '_' + \
'{0:02d}'.format(date_time.month) + '_' + \
'{0:02d}'.format(date_time.day) + '_' + \
'{0:02d}'.format(date_time.hour) + '_' + \
'{0:02d}'.format(date_time.minute) + '_' + \
'{0:02d}'.format(date_time.second) + '_' + 'Fl'
flpath = path + '\\' + flname + '.tif'
return flpath
def Bpath(path):
date_time = datetime.now()
brname = str(date_time.year) + '_' + \
'{0:02d}'.format(date_time.month) + '_' + \
'{0:02d}'.format(date_time.day) + '_' + \
'{0:02d}'.format(date_time.hour) + '_' + \
'{0:02d}'.format(date_time.minute) + '_' + \
'{0:02d}'.format(date_time.second) + '_' + 'B'
brpath = path + '\\' + brname + '.tif'
return brpath
def Conpath(bpath):
p = bpath[:-4] + '_config' + '.txt'
return p
def Dpath():
now = datetime.now()
folderName = str(now.year) + '.' + str(now.month) + '.' + str(now.day)
path = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop') + '\\' + folderName
return path