Exemplo n.º 1
0
# import required libraries
import os
from openpyxl import load_workbook
from resources import get_stats_folder

# set working directory to the directory above where this file is located
FILE_DIR = get_stats_folder()

# set variables
sheet_day = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']

# define functions
def row_thru (os,inws,outws) :
    sc = 2
    if   (os == 0):
        sr = 3
    elif (os == 1):
        sr = 12
    elif (os == 2):
        sr = 21
    elif (os == 3):
        sr = 30
    elif (os == 4):
        sr = 39

    # find correct starting place
    check1 = False; check2 = False; col_coord=0; row_coord=0
    for row in inws.iter_rows(min_row=50, min_col=2, max_col=2, max_row=150):
        if (row_coord != 0):
            break
        for cell in row:
Exemplo n.º 2
0
import os
from shutil import copyfile
from datetime import date, timedelta
from openpyxl import Workbook, load_workbook
from resources import get_stats_folder

path = get_stats_folder()

print("What year? ")
year = 2021  #int(input())


def get_mondays(year):
    sdate = date(year, 1, 1)
    edate = date(year, 12, 31)
    deltadate = edate - sdate

    mondays = []

    for i in range(deltadate.days + 1):
        day = sdate + timedelta(days=i)
        if (day.weekday() == 0):
            mondays.append(str(day.month) + "." + str(day.day))

    return mondays


mondays = get_mondays(year)

# make quarterly directory
#'\\Statistics\\Masters\\Quarterly\\'