Skip to content

Cannot add/append element to JSON File

So, I was making a discord bot for an RP server with 4k members in emergency. My goal was to store the lawyers database in a json file that would be hosted on one of my computers for testing. Here is my code: Here is the Compiler Error (Python 3.9): I tried to look at other posts to see if

Attribute Error: List object has no attribute CheckClick

In the Swap function, I am checking under some index a button class instance, which I checked using print statements, but for some reason it still gives me an error saying that it has no such attribute check click. Any tips on formatting are also welcome, I am just a beginner. I am using three different array…

No module named pip which using virtualenv-based python

When running the system-installed python, I can find pip: However, if I create a virtualenv with this python3 and activate it, then I can no longer find pip: I am completely baffled by this. What is it about reading through a symlink that could make pip disappear? Answer The python’s venv module introdu…

Polymorphism and Type Hints in Python

Consider the following case: Let’s say I’m calling get_base_instance in a context where I kow it will return a Sub instance – maybe based on what args I’m passing. Now I want to pass the returned instance to do_something_with_sub: The problem is that my IDE complains about passing a Ba…