Automate System Notifications Using Python | Beginner Friendly Python Project #pythonprojects

preview_player
Показать описание
In this short tutorial we'll be looking at more Python automation scripts, this time we're focusing on creating automated battery notifications that are controlled by a user Input.

In this beginner friendly tutorial I showcase a script created in the native and simple Python IDE- IDLE. We then work through creating variables, an if statement nested within a while loop, enter a custom battery notification string and watch the fruits of our labour automatically appear before our eyes as the script runs.

If you want to learn to automate your life and improve efficiency, check out the video and associated playlist for more!

🤝 Follow my Data content on Twitter:

🤝 I’m also sharing Data knowledge on Instagram:

🤝 Connect with me on LinkedIn:

🤝 View my Website:

Please Like, Subscribe, Comment & Share if you enjoy!
Рекомендации по теме
Комментарии
Автор

Really nice tutorial, though a few suggestions:

1) "while(True)" is not really a pythonic way to make an infinite loop, almost no one uses it. I would recommend you use "while True:" instead

2) You can use fstrings in
message = str(current_percent) + "% Battery Remaining",
and instead do it as
message = f"{current_percent}% Battery Remaining",
this makes the code more readable and neat

3) The "continue" in the last line is useless, since its an infinite loop and it will start over anyway, so remove it

4) I would recommend that you make an interval of a few seconds before running the loop again, cause else its gonna use up more resources than needed. You can do it via the inbuilt time module and adding the following line at the end of your loop after importing the time module:
time.sleep(3)
By doing this, the loop will run in 3 second intervals

Joe-zgeq
Автор

🦾📈 Watch my full Python for Automation tutorial, covering topics such as automating email, LinkedIn, Excel, PDFs & more!

MatadorSoftware
welcome to shbcf.ru