Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #!/usr/bin/python
  2. import os
  3. import pathlib
  4. import os.path
  5. from datetime import datetime
  6. i = datetime.now()
  7. datess = i.strftime('%d')
  8. months = ["Unknown",
  9. "Jan",
  10. "Feb",
  11. "Mar",
  12. "Apr",
  13. "May",
  14. "Jun",
  15. "Jul",
  16. "Aug",
  17. "Sep",
  18. "Oct",
  19. "Nov",
  20. "Dec"]
  21.  
  22. now = (datetime.now())
  23. year = (now.year)
  24. print (year)
  25. month = (months[now.month])
  26. print(month)
  27. # I want to print C:apache-tomcatstoreretail_sectorsugarYear.month/date
  28. #The exact path is C:apache-tomcatstoreretail_sectorsugar2017.aug/24 but i want to print the year and date as varible
  29. p = pathlib.Path('C:apache-tomcatstoreretail_sectorsugar2017.aug/24')
  30. if p.is_dir():
  31. print "Directory is created"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement