简体   繁体   English

如何在 PyAutoGUI 上编写文件路径

[英]How to write filepath on PyAutoGUI

I'm using PyAutoGUI to type this filepath:我正在使用 PyAutoGUI 键入此文件路径:

 pyautogui.write(r'C:\Users\Alex\Dropbox\PythonDev\Instagram\imagename.jpg', interval=0.1)

However, despite the fact there is "r'" in the beginning of my code, i still have a problem:然而,尽管我的代码开头有“r”,但我仍然有一个问题:

在此处输入图像描述

How can I avoid this problem?我怎样才能避免这个问题?

You can try the following pyautogui.write('C:\\Users\\Alex\\Dropbox\\PythonDev\\Instagram\\imagename.jpg', interval=0.1)您可以尝试以下pyautogui.write('C:\\Users\\Alex\\Dropbox\\PythonDev\\Instagram\\imagename.jpg', interval=0.1)

OR或者

pyautogui.typewrite("C:\\Users\\Alex\\Dropbox\\PythonDev\\Instagram\\imagename.jpg", interval=0.1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM