Sure, here is an example of a Python program that can be run daily and asks the user to log their work each day, and also generates a report at the end of the month in RTF format based on the collected data:
import time
def main():
# Initialize variables for the report
report = ""
# Loop until the user quits
while True:
# Ask the user for their work for the day
print("What did you work on today? (type 'quit' to quit)")
work = input()
# Add the user's work to the report
report += f"{time.strftime('%Y-%m-%d')}: {work}\n"
# Ask the user if they want to continue
if work == "quit":
break
# Generate the report
with open("report.rtf", "w") as f:
f.write(report)
Define the scheduling function
def schedule():
# Check if the user wants to run the program daily
if time.time() % 24 * 60 * 60 == 0:
# Run the program
main()
Schedule the program to run daily
while True:
schedule()
time.sleep(86400) # Run the program every 24 hours
Run the program when the user starts it
if name == "main":
main()
The main() function is the core of the program, it asks the user for their work each day, adds it to a string variable report, and then generates an RTF report using the with open() function.
The schedule() function is used to schedule the program to run daily, it checks if the current time is a multiple of 24 hours, if it is it runs the main() function.
You can run the program by saving it in a file with a .py extension and running it using python myprogram.py.
To make the program run daily you can run it with python myprogram.py and it will run the schedule() function every 24 hours.
You can also add a while True loop in the main() function and add a time.sleep(86400) in it to run the program every 24 hours.
Please note that this is a basic example, you can modify it to suit your needs and also you can use other libraries and frameworks to make it more powerful and efficient.