hello ! I'm kimiko , I'm so lazy recently. It's too hot .jpg
I have time to update you ! Online today —— Write a sister article with this article ~
【Python Too cattle 】 A powerful real-time monitoring CPU Usage rate Professional tools are fresh ~
In the use of Mac Computer office , Sometimes you don't know which software or processes will take up a lot of money Source , Lead to other tasks
appear Slow down 、 Carton And so on . therefore , real time The monitoring system Resources become very important .
But there are a variety of system monitoring software on the market , A wide variety , Which monitoring software is the best ?
Today, I will introduce a super easy-to-use Mac Monitoring software running cat , Hope it can be helpful to your choice .
Uh huh ~win10 The computer said it was not satisfied ,Mac Can have , I can't do less ,SO One A cat monitoring applet of the cure system is made
La ~ I would like to introduce my Tuanzi : I remember it was Second appearance Is that right ~ Ha ha ha
Used to Mac You may know such a software :RunCat.
This is a healing system Mac System monitoring software , It can reside in your system status bar in the form of animation .
Cat can tell you by running speed Mac Of CPU Usage rate . and RunCat Provides keyframe animation for the menu bar , The animation is based on Mac Of CPU Usage change speed .
Of course RunCat Not just cats , There are many animals and animations , such as :
cat — Dog — Cheetah — The rabbit — The dolphins — frog — bird — penguin — Long dragon — gear ️— fire — Water drop — The rockets — Ring ️—— wait .
This application does not have enough advantages in terms of function , But I can't stand it. It's fun . ha-ha Xiaobian likes to introduce some interesting things to everyone ~
In addition, it comes with many free animations , Generally speaking, it is enough .RunCat It is a software that is more suitable for curing boredom in a daze !
The principle is very simple , utilize python Of psutil Bag can easily get the current computer CPU Utilization or running memory
Utilization rate . Then determine the update frequency of the tray icon according to the utilization rate .
Then set by cycling 5 In different states icon To achieve the effect of running , Interested friends can make their own favorite
And then replace what I found OK La ~
Python3、Pycharm. Related modules :psutil modular ; As well as some python Built in modules .
Douban image source is used for module installation :
pip install -i https://pypi.douban.com/simple/ + Module name
Cat can tell you by running speed Mac Of CPU Usage rate , It is mainly a small script made by cat , Other animals can try to do it by themselves ~
import sys
import time
import psutil
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication, QSystemTrayIcon
def runcatCPU():
app = QApplication(sys.argv)
# The program does not exit when the last visible window exits
app.setQuitOnLastWindowClosed(False)
icon = QSystemTrayIcon()
icon.setIcon(QIcon('icons/0.png'))
icon.setVisible(True)
cpu_percent = psutil.cpu_percent(interval=1) / 100
cpu_percent_update_fps = 20
fps_count = 0
while True:
fps_count += 1
if fps_count > cpu_percent_update_fps:
cpu_percent = psutil.cpu_percent(interval=1) / 100
fps_count = 0
# A parabola with an upward opening , Decrease on the left
time_interval = (cpu_percent * cpu_percent - 2 * cpu_percent + 2) / 20
for i in range(5):
icon.setIcon(QIcon('icons/%d.png' % i))
icon.setToolTip('cpu: %.2f' % cpu_percent)
time.sleep(time_interval)
app.exec_()
def runcatMemory():
app = QApplication(sys.argv)
# The program does not exit when the last visible window exits
app.setQuitOnLastWindowClosed(False)
icon = QSystemTrayIcon()
icon.setIcon(QIcon('icons/0.png'))
icon.setVisible(True)
memory_percent = psutil.virtual_memory().percent / 100
memory_percent_update_fps = 20
fps_count = 0
while True:
fps_count += 1
if fps_count > memory_percent_update_fps:
memory_percent = psutil.virtual_memory().percent / 100
fps_count = 0
# A parabola with an upward opening , Decrease on the left
time_interval = (memory_percent * memory_percent - 2 * memory_percent + 2) / 20
for i in range(5):
icon.setIcon(QIcon('icons/%d.png' % i))
icon.setToolTip('memory: %.2f' % memory_percent)
time.sleep(time_interval)
app.exec_()
Runcat A running cat
All right. ~ This article ends here , If you need to try it yourself, hurry up ~
project 3.1 Matting artifact
【 Praise 】 This kind of Python Applet automatic matting only needs 5 second , seckill PS Manual matting ?
project 3.2 Opencv Collection 3 Fairy code
【OpenCV A collection of cases 】 There is such a fairy code , I love you ...... Interesting. ( attach 3 Source code )
project 1.0 Cartoon avatar
【Opencv actual combat 】 How fast Get Exclusive Avatar ? jing — I finally found the picture my girlfriend wanted ~
project 1.1 Anime characters
【 Break through the wall of dimension 】 Who says the second dimension is far away from us ?Python Special effects fire all over the network , The key technology turns out to be it .
project 1.0 Python—2021 | Summary of existing articles | Continuous updating , Just read this article directly
( More + The source code is summarized in the article !! Welcome to ~)