Question

def copypaste():
    x = 289
    y = range(x, 700, 40)
    z = 289+53
    a = range(z, 700, 20)
    b = 289+121
    c = range(b, 700, 20)
    for x in y:
        mouse.smooth_move(376, x)
        clickthrice()
        mouse.click(3)
        mouse.smooth_move(400, x+11)
        mouse.click()
        for z in a:
            mouse.smooth_move(903, z)
            mouse.click()
            mouse.click(3)
        for b in c:
            mouse.smooth_move(927, b)
            mouse.click()

I'm trying to copy one column list visible in the desktop and paste it in another location also in the form of a specific list. one by one. The problem is that it runs all of the second "for loop" for each item in the list of y. The third "for loop" also runs as a whole for each item in the list of y. I need the second and third "for loop" items to run hand in hand with each of the items.

Was it helpful?

Solution

"Hand in hand" would only work when you have equal elements in both a and c. After making them equal you can use -

for z,b in zip(a,c):
    mouse.smooth_move(903, z)
    mouse.click()
    mouse.click(3)
    mouse.smooth_move(927, b)
    mouse.click()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top