Skip to content

Tag: python

I have a TypeError in Python

Products Class code ProductsImplementation class code Below is the error I get when I try to run this Answer You forgot to provide the arguments to the add_product method. Change the last line to:

Kivy: How to access global variables in .kv file

I’m fairly new to kivy and need some help with accessing a global variable in kivy. The idea of this demo code is to be able to update a global variable via a class method. These methods would, in practice, be buttons that a user presses that update the variable. I want to know how I can access this new

discord.py – BanIterator object is not iterable

I’m trying to make an unban command but I have no way of getting the banned users list. This is the code: Error code: I tried even copying the code from this man (https://youtu.be/KS1_3km5vC0) but it doesn’t work. This is the code: Error code: This is all the bot code: Answer as in Documentation ,…

Seach in JSON with variable depth and structure

I have some highly nested JSON files I need to work with. A short example: I would now like to read all names from the JSON file and write them into a list. This is not particularly difficult if the JSON file has a fixed structure. However, my JSON files have a variable structure and variable depth. Sometimes…

How to join sentences inside data frame column?

I have create a sample data frame and it contains a column Called ‘Body’ and the content of it as below. ‘[‘Former India captains should have shown the maturity to sort out the matter privately’, ‘When egos clash, the results are often disastrous. Ugly too. And the row tend…

how to do a pagination bar in PyQT?

I need to paginate data from SQL tables. I cant find any information about pagination in PyQT or Pyside. Can you help me pls? Answer One way to handle pagination is to use the QStackedWidget for emulating the pages themselves, and regular QLabels as the page links. Then you can override each labels mousePress…