bhargavnova / python-helper-modules

MIT License
7 stars 24 forks source link

Random Time Sleep Module with Live Countdown #4

Closed bhargavnova closed 9 months ago

bhargavnova commented 9 months ago

Objective: Create a Python module that incorporates a function for random time sleep, allowing the script to pause execution for a randomized period between two specified values. Additionally, implement a live countdown feature on the console, where the countdown value gradually decreases while the script is sleeping.

Requirements:

  1. The module should include a function for random time sleep, accepting minimum and maximum sleep durations as parameters.
  2. During the sleep period, a live countdown should be displayed on the console, indicating the time remaining.

Difficulty: Beginner

Example Usage:

# Example usage of the random time sleep module
import random_time_sleep

# Sleep for a random duration between 2 and 5 seconds
random_time_sleep.sleep(2, 5)

Note: Feel free to explore creative ways to implement the live countdown feature, such as using dynamic console updates or visual indicators. This enhancement will greatly enhance the user experience of the module.

avyuktsoni0731 commented 9 months ago

Hi @bhargavnova ! I am new to making time module python programs. Can i please get some more info about what we are to do in this issue? Another thing, when we choose a random sleep duration, from what time are we supposed to make a countdown? Please let me know, I am interested in this issue.

Thanks : )

bhargavnova commented 9 months ago

@avyuktsoni0731 , Thanks for your interest in this module. Actually, whenever we need a script to sleep for a specific amount of time we just do time.sleep(3) [this will pause the execution for 3 seconds]

Now sometimes we need more functionality where we want the script to sleep for a random amount of time, between two integers, for example :

More interestingly What if we can display a live countdown of sleeping seconds on the console, that's what this function is all about. (tip: string manipulation in python print() function)

It's very simple, a script like 4-5 lines of code, but it's pretty good for beginners to work with developing logic, and how you can achieve that.

hope this clears things out, you can try understanding that, and let me know if you need anything else, if you think you can do this I will assign it to you.

Happy Coding!! :)

avyuktsoni0731 commented 9 months ago

@bhargavnova, Thank you so much for explaining things in such a detail and easily.

Yes! I definitely think I can work on this issue and make it work! Please assign this issue to me, it would be great to learn new concepts.

Thank You! :)

bhargavnova commented 9 months ago

Sure!! : ) Happy Coding!!

bhargavnova commented 9 months ago

Appreciation for Your Contribution! 🌟

Dear @avyuktsoni0731 ,

I hope this message finds you well! I wanted to take a moment to express my heartfelt gratitude for your valuable contribution to this repo. Your efforts and dedication have truly made a positive impact.

I encourage you to continue exploring and contributing to the repo. Your skills and perspective are a valuable addition to this community.

Once again, thank you for your time, effort, and enthusiasm. We look forward to more collaborations in the future!

Warm regards,