Category "python"

Python and spreadsheet: given the user input, expand the list of results using regex

I'm working with Python on a movie database on google sheets. I want to build a query searching a list of names and surnames on three columns. I ask the users t

Python flatten rows of 2D list

Currently working on a program that requires the flattening of columns, rows, and diagonals of a 2D list. I have written the following code that flattens the co

Generate Network Graph in Python from nested dictionary

I have an input dictionary like: d={'node1':{'node1_1':1.2,'node1_2':1.3,'node1_3':1.2},'node2': {'node2_1':1.3,'node2_2':1.3,'node2_3':1.4}} In th

How to add menu in python from a loop

for user in users: self.user_menu.add_command(label=user[0], command=lambda: self.userChange(user[0])) in the label user[0] works fine but

JSON link from google developer tools not working in Python (or in browser)

I am trying to extract the data in the table at https://www.ecoregistry.io/emit-certifications/ra/10 Using the google developer tools>network tab, I am able

Abstract class with multiple inheritance error: Can't instantiate abstract class ... with abstract method

I'm trying to get the following to work: from abc import ABC, abstractmethod class Abc1(ABC): def __init__(self, example_variable_1: int) -> None:

Disappearing handlers of logger in Python

I'm having trouble with using logging for multiprocessing Processes. As I understand all processes are separate ones so each process have their own logger. What

Django Authentication method is not working

I am trying to use the default Django from django.contrib.auth authenticate() method to authenticate if the user exists. I am doing this right after the user re

How to change from reading files to sys.stdin.readlines

How should I change the code if I want to change the file import to sys.stdin.readlines? I changed it several times and got different errors. Please I need some

having trouble in getting all the P tags of page

the article passages are divided into different divs tags like in the image you can see it is written data-page-number="2" just like that the data is divided i

How to cleanup BigQuery export to CSV using pandas

I exported my BigQuery data to CSV but can't figure out how to clean up the data as the headers are all appended on the backend in the same row. Here's my code:

Discord py, get rate limit timer

I have a bot written in python. Help me deal with HTTP requests. There is a task: rename the channel on command. But discord has a limit on renaming the channel

How do I get a cell's color from a Google Sheets doc in Colab (python) without Google API?

I am importing a Google Sheets document into Google Colab for data analysis using python. I would like to get formatting information from the Google Sheets docu

Python 3.9 logger RotatingLogger doesn't write anything into file

I created a simple demo to test my Django project. when i invoke unittest, everything passed and i set logger.info to record log into debug.log. There should be

URL and page refresh issue for Multilingual site on Django

plz help me to solve one issue. I have a Multilingual site on Django with standart internationalization framework. Settings.py MIDDLEWARE = [ ... 'djang

program that asks the user to input a string with at least three characters and displays a new word with the word “car” after first three characters

In python how do you write a program that asks the user to input a string with at least three characters and displays a new word with the word “car”

to import pyqt5.uic, do I have to install pyqt5-tools first?

to import pyqt5.uic, do I have to install pyqt5-tools first? (venv) PS C:\Users\77140\AppData\Roaming\Anki2\addons21\myaddon> pip freeze | grep PyQt PyQt5-Q

How to set the resolution of a Raster using gdal.Grid in python 3?

How to set the output resolution of the raster generated in gdal.Grid? I am using the code below, which produces a TIF with very large cells (~70m) however the

problems counting rows and columns with no spaces in a matrix

Im trying to find the number of rows and columns in a matrix file. The matrix doesn't have spaces between the characters but does have separate lines. the sampl

FastAI : Getting Prediction of Image from Learner

I want to be able to predict the Class of a Single Image from the Learner and i always get an Index Out of Bound Exception . Here is the Code data = ImageDataLo