import os
from appscript import *


this = app(u'System Events').application_processes[param1].windows[param2].exists()
while True:
    this1 = app(u'System Events').application_processes[param1].windows[param2].count(each=k.radio_button)
    if count == (this1):
        this2 = app(u'System Events').application_processes[param1].windows[param2].radio_buttons[param3].click()
        try:
            os.makedirs(param1)
        except OSError:
                if os.path.exists(param1):
                    this3 = os.system('screencapture -C '+ param1 +'/'+ param2)
                    while True:
                        self.param2 = os.path.join(param1, 'win%s_%s_img_%s' % (param1, param2)) 
                        return param2 + 1 
                    time.sleep(delay)
                    pass
                else:
                    raise
                
        this4 = app(u'System Events').application_processes[param1].windows[param2].buttons[param3].click()
    
    else:
        continue

this part of my code got an error, i dunno what it is. someone help. Thank you

The error message says that the 'return' statement is outside the function.
What's with the line 17:
return param2+1

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.