Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why my indentation can not work in python while True: loop

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading