【问题标题】:How can we refresh our Windows with python just like we do at the desktop (right click and click to refresh)我们如何像在桌面上一样用python刷新我们的Windows(右键单击刷新)
【发布时间】:2020-04-28 17:01:11
【问题描述】:

请有人帮助我! 我是新来的。 我厌倦了在网上搜索它。 是否可以使用 python 刷新 Windows? 如果可以的话,我们可以用python中的'os'模块来做吗?

import os

【问题讨论】:

  • 这个问题/答案可能会有所帮助。 stackoverflow.com/questions/1517038/python-refresh-reload
  • @Rick Colgan,我认为他并不是要重新加载软件包,而是想调用一些 windows api,这反过来会与在桌面上单击鼠标右键并单击刷新一样。跨度>
  • @mergenchik 是的,没错!我想要和你说的一样。谢谢你!

标签: python-3.x


【解决方案1】:
import pyautogui as dp
import time

dp.hotkey('win', 'd')

dp.position(x = 1920,y =540) ### You can change x and y based on the resolution of your pc
dp.click(x = 1920,y =540,button = 'right')

dp.click(x = 1900,y =620)## These coordiantes are not universal, changes as per the pc resolution

【讨论】:

  • 非常感谢@Jai Shankar!它工作正常。
猜你喜欢
  • 2021-08-20
  • 1970-01-01
  • 1970-01-01
  • 2017-09-15
  • 1970-01-01
  • 1970-01-01
  • 2020-04-09
  • 2022-10-04
  • 2012-05-29
相关资源
最近更新 更多