Skip to content

Tag: python

How to iterate the loop if the condition is not met

I am trying to get the id of respective movie name in that i need to check whether the url is working or not . If not then i need to append the movie name in the empty list print(movie_buff_uuid) if i passed the data2 in the above loop i am getting this error urllib.error.HTTPError: HTTP Error 404: Not Found

Repeated drawings of bounding box

I would like to simply make a bounding box that uses points(any amount) to follow my mouse around. Error being when I draw the bounding box currently it repeats all the previous drawings and have repeated bounding boxes Answer You had already the right idea creating a clone from the original image, but just f…

Python, how to sort this dictionary right?

I started 100 days of code and this project is a silent auction (day 9). You take a user’s name and bid price, store it in a dictionary, and then clear it (prompting to see if there are other users). The whole point is to collect the keys/values (that are unknown) and sort them so that it prints the hig…

unexpected behavior with EnumMeta class

I defined an IntEnum for some weather codes and provided a metaclass. as show above it functions as expected when passed into a dict. but if I change the method name of names to keys like … I get an unexpected result It was my understanding that dict calls the __iter__ method under the hood to create a …

While/For/If Else Loop after checking user input

I’m new to Python and learning. I’m trying to write a program to: User input full name (with space) Check duplication to a list (I used split and join to compare strings) If find a duplication, re-input new name If not, simply break the loop and print “Thanks” I only need to print &#82…

How to renew scrapy Session

—– EDIT —- Rewrote the topic + content based on previous findings I am scraping using a proxy service that rotates my ip. In order to obtain a new ip, the connection needs to be closed with my proxy service, and a new one opened with the new request. For instance, if I go to http://ipinfo.io…