chophouse 25 Newbie Poster

I'm embarassed to admit this, but maybe it will help someone else from doing the same stupid thing. I started out writing funky.py in the 101scripts directory. Then decided I should have a separate directory for my own reusable functions so created My_Own_Stuff directory, called it out in PYTHONPATH and continued to work on it. Problem was, I left the original copy in the 101Scripts directory so it never got updated. So when 101Scripts was the working directory, my scripts were looking at the old funky.py module which didn't have the doyr function in it (but did have fileup). Lesson learned. Pay attention to your housekeeping!!

TrustyTony commented: Nice sharing mind! +12
chophouse 25 Newbie Poster

Did a bit more research and discovered the magic of strftime which I think solves my problem.

I replaced lines 12 thru 21 in my original example with:

# gets date of last Tuesday
endwk = nowdate - datetime.timedelta(days = wkday)  # need this later as a datetime object
d1 = endwk.strftime("%Y%m%d")


# gets date of the Tuesday a week before last Tuesday
startwk = endwk - datetime.timedelta(days = 7) 
d2 = startwk.strftime("%Y%m%d")
Gribouillis commented: excellent ! +13