79.1 - Python, Weeks to years and months

Опубликовано: 16 Июль 2024
на канале: WesleySon
24
0

Creating a cute little program that asks for an input (number of weeks guesstimated to complete the project) and it will spit out a text where weeks have been translated into years and months.
I decided to round months up (3 weeks becomes 1 month) to say "the project will be completed within this time).

You can optionally use libraries like pyperclip to copy the text instantly, or pyautogui to type it into the previous window (alt-tab then type).
I chose to use the input() function to keep the window open, and you must manually type the value.


00:12 Get whole years
00:42 Remaining weeks
00:52 Accounting for rounding up to 1 year
01:40 Weeks to months
04:14 Text and conditions
06:55 Fixing 'None'
08:45 Always test many values......
09:02 Extract the value
09:57 Pyperclip
10:25 Pyautogui
11:00 Input()