Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Disable your ad blocker to continue using our website.
Python code
Need some help fixing a computer problem, or just want to share a link to a program? Do it hear... From the PC to the CB!!!
- Bozo
- Owner
- Posts: 9414
- Joined: August 31st, 2004, 1:06 pm
- Handle: Bozo The Clown
- Real Name: James Wadsworth
- Antenna: Monkey Made MM9
- Radio: General Lee Radio
- Contact:
Re: Python code
@JetSetter --- Sorry I missed this. To create a Python program that prints a message at the same time Monday to Friday, you can use the schedule library. The complete code for the program is below:
First, install the schedule library if you haven't already:
Now, here is the Python script:
This script schedules the job() function to run at 10:00 AM from Monday to Friday. You can change the time "10:00" to any desired time. The script will continuously check for the scheduled time and run the job() function when it matches.
First, install the schedule library if you haven't already:
Code: Select all
pip install schedule
Code: Select all
import schedule
import time
from datetime import datetime
def job():
print("This is your scheduled message.")
# Schedule the job to run at the same time Monday to Friday
schedule.every().monday.at("10:00").do(job)
schedule.every().tuesday.at("10:00").do(job)
schedule.every().wednesday.at("10:00").do(job)
schedule.every().thursday.at("10:00").do(job)
schedule.every().friday.at("10:00").do(job)
# Keep the script running
while True:
schedule.run_pending()
time.sleep(1)
Jump to
- Welcome and Community
- Skip Shooter's Paradise
- ↳ General Discussions
- ↳ Watergates & Videogates
- ↳ Shooting Skip
- ↳ Hall Of Fame
- ↳ Journal
- Radio Help
- ↳ Intro To Radios 101
- ↳ General Questions
- ↳ Base Setups
- ↳ Mobile 🚗 / 🏠 Base Install Help
- ↳ Competition Rigs
- ↳ Amplifiers / Power Supplies
- ↳ Charging System
- ↳ Mobile Setups
- ↳ Antenna Help
- ↳ Microphone Info
- ↳ Radio Modifications
- ↳ Shortwave Radios / Scanners
- ↳ Sideband (SSB)
- ↳ Tube Radio Equipment
- ↳ Other Technical Questions
- ↳ Miscellaneous Radio
- Buy / Sell / Trade
- ↳ For Sale Area Rules
- ↳ For Sale Area
- ↳ eBay Shopping
- ↳ Amazon Shopping
- ↳ Trade Equipment
- ↳ Wanted Radio Equipment
- ↳ Positive Feedback
- Off Topic
- ↳ Miscellaneous Chat
- ↳ Computer Help
- ↳ Signature Test Area
- The White House
- ↳ Ask Marv
- Federal Communications Commision (FCC)
- ↳ F.C.C. Rules And Regulations
Cbrt left panel
'CBRT' right panel
- Home
- All times are UTC-06:00
- Cookie-Settings
- Delete cookies
- About us
- Downloads
- Contact us
Maxthon style by Culprit. Updated for phpBB3.3 by Ian Bradley
Powered by phpBB® Forum Software © phpBB Limited
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
⇧
⇩