-1

I have a folder, which I'm trying to input in Python as a string, for example folder = r'C:\Users\Desktop' or folder = 'C:\\Users\\Desktop' I'm then using pyautogui.typewrite(folder), but when I do so the directory name is pasted as C'<Users<Desktop Do you know what is causing that and how can I solve this issue? Thank you!

Gustavo
  • 1
  • 3

1 Answers1

0

[Solution]

Combining both inputs from "SuperStormer" (thanks a lot!!) along with some additional research and adaptation I manage to solve the issue by:

  1. Change the keyboard to English - looks like pyautogui emulates the typing of the keyboard, and it doesn't support any language other than english - this almost solved my issue, it solved the backslashes, but then the ":" started to become a "?", like 'C?\Users\Desktop'
  2. Use pyperclip to paste string directly from keyboard - I did some simulations and that would have worked, except that I already had something on my clipboard that had to be used in a later step, and as I couldn't find a way to reference more than two clipboards at a time that didn't work right away, but after some workarounds based on that function I finally got to the solution
Gustavo
  • 1
  • 3