Class in Python
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
@abstractmethod, @staticmethod, abstract class, etc.
override,
prefer classmethod to static method;
both class and static methods can be override
Meta Class
https://stackoverflow.com/questions/100003/what-are-metaclasses-in-python
It seems to me …
Schdule Jobs in Python
Tips and Traps¶
- If you schedule a job $J_1$ using
schedule
in IPython shell, and then interrupt the following loop that checks and runs pending jobs,the scheduled job $J_1$ is still there unless you stop the current IPython shell. The effective consequence of this is that if you schedule another job $J_2$, and start to run it using the following loop,while True: schedule.run_pending()
The Installation Location of Python Packages Using Pip
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
When installing a Python package using
pip
without usingsudo
or theroot
user, the package is installed into the user's local directory at~/.local/lib/python3.7/site-packages
(using Python …Take Screenshots in Python
Comments¶
- PIL.ImageGrab works on macOS and Windows only.
PIL.ImageGrab
is relatively slow.python-mss
andPyQt5
are better alternatives if performance of screenshot is critical. Notice that saving an (e.g., PNG) image can take significant time (might take up to 0.5 seconds) too, this is often due to image compression is slow. Lower the compression level can significant reduce the time needed to save an image. Please refer to Saving a PNG file is slow
Tips on PyQt5
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
https://www.youtube.com/watch?v=0wAU5usATX8
Good Tutorials