Skip to content
Advertisement

Why am I getting django.db.models error telling me I have no attribute for TextChoices in Django (3.1.6) and Python(3.8)?

thanks so much for reading. I’ve got this running on my computer no problem. It’s working on my VS on Windows 10. But this error keeps coming up, it looks like TextChoices is no longer usable? AttributeError: module ‘django.db.models’ has no attribute ‘TextChoices’ I’m putting it u0p on PythonAnywhere, Python 3.8, and Django 3.1.6 I am still new at this,

Comparing 2 randomly generated lists in python

I am trying to make a program that will generate a list filled with randomly generated characters, then repeatedly randomizing another until both of them match up. However, when I run the following program, even at the lowest value, it will continuously run, forever. Answer You keep on appending to your second list in your while loop. Simple reset your

Issue with conversion of text data into a dataframe

I have a text file where I have several lines and between them, some data which I need to convert to the dataframe(useful data). I iterated the text file line by line and captured the useful data with the help of a regex. Something like this, The data captured look like this I thought to iterate each captured row and

How to format json so I can parse floats and strings

I am getting the error when I try to run the following code. I know it has something to do with the formating of the json file but I am not sure how to proceed/change in order to be able to get floats from the json file my code Answer data[‘listingReducer’][‘geoCode’] is a dict so doing for location in data[‘listingReducer’][‘geoCode’]gives

Pygame window isn’t updating

I’m writing a small python game just to learn how to use python better. I wanted to try to start using multiple scripts, as keeping all of the code in one script can get a little crowded. I made a second script, created a function main(scrn) and everything seems to be working fine. Calling that function in my main script,

Advertisement