I have a ‘say’ command for my bot where it repeats what the user writes in the command message: I want it to also include the attachments if the user included any, but i can’t seem to get it to work. I keep getting the error: What am i doing wrong? In the discord.py docs it says that the ctx…
Python “ModuleNotFoundError: No module named ‘flask'”
I am a beginner with the python programming. I have python 3 installed in my local system. I coding along as part of a tutorial video and as part of the tutorial, i have created a virtual environment and created an app.py file with the below content. I have installed all the dependencies like flask and pytest…
How can you select a specific dictionary by id in order to update its contents(Python)? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question Hello, I have to create a program that is able to add a transaction with the following detail…
Problem with Django does not detect change in python code every time need to restart the server (problem in runserver)
I have a problem my django server does not show the updated python code when refreshing the page everytime i need to restart the server i searched the internet and all what i found is when i run the server it automatically detect any change in the code but i use it and it does not detect the change any
Create array of differences in col between two adjacent numbers in an array python/pyspark
I have a column of arrays made of numbers, ie [0,80,160,220], and would like to create a column of arrays of the differences between adjacent terms, ie [80,80,60] Does anyone have an idea how to approach this in Python or PySpark? I’m thinking of something iterative (ith term minus i-1th term starting a…
How to get HTML changes after pressing button with Beautiful Soup and Requests
I want to get the HTML this site https://www.forebet.com/en/football-predictions after pressing the button More[+] enough times to load all games. Each time the button More[+] on the bottom of the page the HTML changes and shows more football games. How do I get the request to the page with all the football g…
Create a List in Python from Value of Max Data
I want to create a list in Python from the dataset below: With some data wrangling by transposing the data to convert the value with this code: The data frame look like this: For example, Final result that I expected should be a list that consists a maximum value from each column: Answer You can try this: Out…
Are these `.` attribute bindings necessary in the implementation of `functools.partial`?
docs.python.org says that functools.partial is roughly equivalent to: (Note: / is used to denote func as a positional-only argument of partial. See [1].) If I understand correctly, when a variable is referenced within a nested function, such as newfunc, Python first looks for the variable definition within th…
Saving states of QRadioButtons using QSettings not persisting values correctly in PyQt5
I’m baffled by the results of using QSettings to save the state of my radio buttons from one app session to another using PyQt5. (OS = Ubuntu Linux 18.04) These are the steps to produce baffling results: Run the app; see both radio buttons selected; both buttons fire as if mouse selected Deselect the to…
How to retrieve all the charges for a specific customer in Stripe using the customer ID?
I have the customer ID for a specific customer in Stripe. How can I retrieve all the charge objects for this customer? The customer object can be retrieved using the following code: Answer This will do it