课程: Level Up: Python
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Schedule a function
(video game bleeps) - It can be useful to schedule parts of a program to execute at specific times. Just like setting an alarm to wake yourself up in the morning. Your goal for this challenge is to write a Python function which sets an alarm by playing a sound file and printing a message at the specified time. The function should have three inputs, for the time you want to set the alarm to go off, the sound file you want to play, and the message to display. A call to your set alarm function might look like this using the current system time, plus one, to set an alarm for one second into the future. Pause the video now to create your own solution. Then I'll show you how I solved this challenge. (video game bleeps) All right, for my solution, I used two modules from the Python standard library. The sched module, which implements a general purpose event scheduler and the time module, to manipulate the time units, and…
内容
-
-
-
Find prime factors3 分钟 11 秒
-
(已锁定)
Identify a palindrome2 分钟 48 秒
-
(已锁定)
Sort a string3 分钟 2 秒
-
(已锁定)
Find all list items3 分钟 12 秒
-
(已锁定)
Play the waiting game2 分钟 22 秒
-
(已锁定)
Save a dictionary3 分钟 13 秒
-
(已锁定)
Schedule a function3 分钟 16 秒
-
(已锁定)
Send an email3 分钟 12 秒
-
(已锁定)
Simulate dice3 分钟 16 秒
-
(已锁定)
Count unique words3 分钟 12 秒
-
(已锁定)
Generate a password3 分钟 59 秒
-
(已锁定)
Merge CSV files3 分钟 35 秒
-
(已锁定)
Solve a sudoku4 分钟 8 秒
-
(已锁定)
Build a zip archive3 分钟 42 秒
-
(已锁定)
Download sequential files4 分钟 2 秒
-