简体   繁体   中英

How to write filepath on PyAutoGUI

I'm using PyAutoGUI to type this filepath:

 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:

在此处输入图像描述

How can I avoid this problem?

You can try the following 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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