hello in my code is a lot of error that we can remove only with restarting a script so I use a while true loop and try: to continue but I am still in the inclosed cycle. But please a code in if and else is not important only a indentation
while True:
try:
# video tas can be used for an image
if len(video_tags) == 1:
#That meaan that a code1 or code2 function will be activated
# I deleted a code1 function because a gifs was in the bad quality
code2_function()
print("Function code2 has been activated")
check_px("code_img.png")
image_resize("code_img.png",1920,1080,"res_image.png")
if get_rgb("res_image.png",1730,11) > 700:
print("white")
img_edit("res_image.png","QR_white.png",1580,20,"prep_image.png")
else:
print("black")
img_edit("res_image.png","QR_black.png",1580,20,"prep_image.png")
audiovizualizere("output.mp3","prep_image.png")
#Everithink is done
else:
print(video_tag)
video_or_image = random.choice(["image","video"])
print(f"This a random picker to video_or_image: {video_or_image}")
if video_or_image == "image":
pexels_or_pixabay_image = random.choice(["pexels","pixabay"])
print(pexels_or_pixabay_image)
if pexels_or_pixabay_image == "pexels":
print("A image to video from pexels has been activated!")
image_to_video_from_pexels(video_tag,"image_from_pexels.png")
check_px("img_from_pexels")
image_resize("img_from_pexels.png",1920,1080,"res_image.png")
if get_rgb("res_image.png",1730,11) > 700:
print("white")
img_edit("res_image.png","QR_white.png",1580,20,"prep_image.png")
else:
print("black")
img_edit("res_image.png","QR_black.png",1580,20,"prep_image.png")
else:
# this is only temporary
print("A image to video from pexels has been activated!")
image_to_video_from_pexels(video_tag,"image_from_pexels.png")
check_px("img_from_pexels")
image_resize("img_from_pexels.png",1920,1080,"res_image.png")
if get_rgb("res_image.png",1730,11) > 700:
print("white")
img_edit("res_image.png","QR_white.png",1580,20,"prep_image.png")
else:
print("black")
img_edit("res_image.png","QR_black.png",1580,20,"prep_image.png)
audiovizualizere("output.mp3","prep_image.png")
# Video section good
else:
# code here is not important
break
except Exception:
continue
where I have a problem
>Solution :
You’re missing ") at the end of line 49, the line that says img_edit("res_image.png","QR_black.png",1580,20,"prep_image.png