Is there a way to do this in python?:
def exist(path_image):
if path.isfile(path_image):
return path_image
else:
return False
path_image = '/home/user/image.jpg'
if (image = exist(path_image)):
print(image)
Other languages like PHP and Javascript, I can initialize a variable inside 'IF'
Thanks