So, I’ve got a bot that can send a user a DM via a very simple command. All I do is “!DM @user message” and it sends them the message. However, people sometimes try responding to the bot in DMs with their questions, but the bot does nothing with that, and I cannot see their replies. Would th…
Does Python evdev library have an event specific grab or passthrough?
A python evdev device has a .grab() function that prevents other processes from getting input events on the device. Is there any way to limit this to specific events from a device? For my example, if I .grab() a pen input device that has pressure sensitivity and tilt and 2 click buttons on the side, how would…
Scrapy not sending post request
I was trying to make a post request to a URL but scrapy isn’t sending the post request. I am not getting the correct response. Below is my code. Answer You have a typo in your code here:
Why can’t I initialize instances using for loop – Python, class
error: name ‘w1’ is not defined I tried to use for loop to initialize all the workers( w1, w2, w3) so i can access them afterwards. But when I try to access them they say the instance is not defined, is it possible that you cant initialize using for loop. Thanks in advance, beginner here. Answer I…
itertools’ islice(count()) vs range()
Real quick one: I just saw a tutorial where they show we can use itertools’ islice() and count() together like so: Is there any advantage in doing this instead of using range() ? Answer Is there any advantage in doing this instead of using range() ? In this example there is no advantage and range would …
Python: Beautiful Soup’s “find_all” does not extract any content from HTML
I am currently trying to webscrape googles playstore. More specifically I want to create a dataset, that contains ratings of the disney+ app. Based a tutorial on webscraping (Building a dataset of Graphic Cards on “Newegg.com”) I had no troubles in extracting the necesary information from the webs…
Webscrape a product website like thingiverse
I am very new in webscraping and I am trying to do a small project where I can scrape a website like Thingiverse or similar where different CAD (or similar) files are shown. I am trying to for a particular Search keyword obtain a list of all the results. When I inspect the website the different products are h…
Python – read txt file into list – display contents of the new list
I did ask this before on a different account but i lost the account and didnt see most comment or answers people gave so i have asked on this older account of mine Im new to python and programming in general so i am not understanding what i should be doing to get the output that is expected. I think
Regex within Pandas DataFrame – finding minimum length between characters
Edit: Updated for reproducibility I am currently working within a Pandas DataFrame, with a list of strings held within each row of a column [Column A]. I am trying to extract the minimum distance between any sublist combination of a keyword list (List B) whilst each row in the Dataframe column contains a list…
Authorization error 401 using API – Python
This is my first time using an API in Python. I want to give a query on the website http://data.bioontology.org. Not sure what the API_KEY has to be. Also, I do have an account on this website but I do not have to log in to get a query result. Can someone please help me out? Here’s the error output: