Python code to automate desktop activities in windows

前端 未结 5 1889
旧巷少年郎
旧巷少年郎 2020-12-02 11:16

I want to automate desktop activities in Windows environment using Python. How it can be done? Some examples will also be helpful.

By desktop activities, I mean acti

5条回答
  •  庸人自扰
    2020-12-02 12:07

    You can lock your PC(Win + L)

    import ctypes
    ctypes.windll.user32.LockWorkStation()
    

    You can clear your recycle bin

    import winshell
    winshell.recycle_bin().empty(confirm=False, show_progress=False, sound=True)
    

提交回复
热议问题