Category "python-3.x"

Django 4: Product.objects.get(id=1) returns an error "DoesNotExist" but I already have 7 products listed

I already have 7 products listed in my DB and I can check them by Product.objects.all() but when I do Product.objects.get(id=1) or pass any id as a parameter it

How can I include external modules when compiling Python code with Cython?

I have an extension that I compile with cython into the related *.pyd or *.so files, which are then imported into my very basic main.py: if __name__ == "__main_

Python Django error "Select a valid choice. That choice is not one of the available choices."

I am relatively new to Django so I am likely doing something obviously wrong but I cant seem to figure out what exactly. I have a model called Report and this h

havie been using js fetch api to post data from the cllient side to the server side in django but its not been posting

haven been trying to fetch data from client side to the server side(url='/update/' using js fetch,been getting the response but the data is not being posted to

Convert text file into dataframe with custom multiple delimiter in python

i'am new to python. I have one txt file. it contains some data like 0: 480x640 2 persons, 1 cat, 1 clock, 1: 480x640 2 persons, 1 chair, Done. date (0.635s) Tue

Python - Division by zero

how can i make something divided by 0 equal base, EX: 5/0 output 5 Sorry I can't explain properly, I'm new to programming

Get rid of single quotes from the substituted string within sed command in Python

I have a text file 1.txt which has following content: module abc I am trying to generate multi-line string that I need to add before module abc line in 1.txt.

how to use Google Cloud Translate API for translating bulk data?

I have a csv file of several thousands of rows in multiple languages and I am thinking of using google cloud translate API to translate foreign language text in

pyautogui, locate on screen doen't work in linux

I am using linux, and it returns none instead of the co-ordinates. import pyautogui as p a=p.locateCenterOnScreen('like.png',confidence=.5) print(a) Did I di

Can't get all table elements using selenium webdriver

I'm trying to get all information from this website using Python/Selenium: https://bitinfocharts.com/top-100-richest-bitcoin-addresses.html I have successfully

Flask Unique SQLAlchemy with Flask-LImiter

I want to make a project with flask where you sign up and sign in and then you can make new posts. I use flask-limiter to prevent users from making new posts. A

Compare 2 columns in excel using python

Hello I have an excel file (.xlsx) with 2 columns of data I want to compare the rows in column A with column B and output the value of column B in another gener

find max value in a list of sets for an element at index 1 of sets

I have a list like this: dummy_list = [(8, 'N'), (4, 'Y'), (1, 'N'), (1, 'Y'), (3, 'N'), (4, 'Y'), (3, 'N'), (2, 'Y'), (1, 'N'), (2, 'Y'), (1, 'N')]

How can I disable debian python path/recursion limit

So, as of late, I've been having path length limit and recursion limit issues, so I really need to know how to disable these. I can't even install modules like

TypeError: 'float' object cannot be interpreted as an integer on linspace

TypeError Traceback (most recent call last) d:\website\SpeechProcessForMachineLearning-master\SpeechProcessForMachineLearning

*** ValueError: not enough values to unpack (expected 2, got 1)

I'm trying to compare two dicts: > x_state [{'ID': 1, 'Wert': '6,6743', 'Name': 'Δ'}, {'Wert': 'Δ', 'ID': 3, 'Name': 'Δ'}, {'ID': 4, 'Name'

How to use Python-Operator % for multiple values?

I'm trying to fill an SQL database with soma data, measured by an bme680. Therefore I'd like to format the measured values like this: print ("Temperatur: %0.1f

Does a Pipeline object store the score of the data it trained with?

I was wondering if a saved model in a Pipeline object contains the score of the data with which it has been trained. If so, how to get that score without having

specific text in prompt for pythonscript

In JavaScript, you can use prompt("This text is above the field of the prompt.", "This text is in the field of the prompt.") to get a customized window appearin

Getting Bad Gateway and Connection reset by peer using asyncio + aiohttp

Is there some async expert with sharp eyes around? I am using asyncio (Python 3.9) with aiohttp (v3.8.1) to fetch multiple urls asynchronously through a proxy,