The function P_10
is supposed randomly select a path from the dictionary Pic_10
and write it to pic_loc
. Then the function py_auto
is supposed to move the mouse cursor windows, explore the address bar, then write in the path to the folder.
It moves the cursor to the address bar but does not write anything.
Why is this code not working?
import pyautogui
import random
a = 287
b = 60
def py_auto():
pyautogui.moveTo(a,b, duration = 1)
pyautogui.click(a,b)
pyautogui.write(pic_loc)
pic_loc =r""
Ovs_a_325 = r"D:\HOUSE PICS\10 marla\3F Ovs a ext @325"
OVB_8_425 = r"D:\HOUSE PICS\10 marla\8 overseas b @425"
ovb_40a_330 = r"D:\HOUSE PICS\10 marla"
tulip_47_350 =r"D:\HOUSE PICS\10 marla\47-c tulip @ 350"
Pic_10 = {
1:Ovs_a_325,
2:OVB_8_425,
3:ovb_40a_330,
4:tulip_47_350}
def P_10():
global pic_loc
pic_loc = random.choice(list(Pic_10.values()))
P_10()
py_auto()