【问题标题】:Python: How to get the left or top in pyautogui.locateOnScreen as int?Python:如何将 pyautogui.locateOnScreen 中的左侧或顶部作为 int?
【发布时间】:2020-04-14 16:35:44
【问题描述】:

如何将左侧、顶部、宽度和高度作为 int 值而不是标准的“框(左侧、顶部、宽度、高度)”。我需要这些值来制作 if 语句,例如:“if left

提前致谢!

【问题讨论】:

    标签: python automation bots pyautogui


    【解决方案1】:

    更新:

    您可以只使用 x[0] 作为左侧,使用 x[1] 作为顶部等。

    注意:这在 x=​​"None" 时不起作用。尝试调用 x[something] 时,使用 'try' 来防止代码崩溃。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-10
      • 1970-01-01
      • 2011-03-27
      • 2016-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多