Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import os
- import pathlib
- import os.path
- from datetime import datetime
- i = datetime.now()
- datess = i.strftime('%d')
- months = ["Unknown",
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec"]
- now = (datetime.now())
- year = (now.year)
- print (year)
- month = (months[now.month])
- print(month)
- # I want to print C:apache-tomcatstoreretail_sectorsugarYear.month/date
- #The exact path is C:apache-tomcatstoreretail_sectorsugar2017.aug/24 but i want to print the year and date as varible
- p = pathlib.Path('C:apache-tomcatstoreretail_sectorsugar2017.aug/24')
- if p.is_dir():
- print "Directory is created"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement