Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import pandas as pd
  2. import datetime as dt
  3.  
  4. def main():
  5. try:
  6. Comm_Data = pd.read_excel(r"path to read")
  7. EO_Cat_Comm = pd.read_excel(r"path to read")
  8.  
  9. Comm_Data = process_data(Comm_Data)
  10. Comm_Data = check_date(Comm_Data)
  11. except Exception as e:
  12. print("Error in Code:", e)
  13.  
  14. def check_date(x):
  15. current_date = x.iloc[0]['Alert_Date']
  16. current_date.to_csv('002_currentdateprocessing.csv')
  17. print(current_date)
  18.  
  19. now = dt.datetime.now().date()
  20. if(now.weekday()==5 or now.weekday()==6):
  21. print("Day is "+now.strftime("%A") + ".Code is not scheduled for " + now.strftime("%A") + ".Come back tomorrow!!")
  22. sys.exit()
  23.  
  24. def process_data(x):
  25. # some code here
  26. return(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement