Category "python"

How can I speed up the aiohttp parser bs4?

The task is to get data from the site. I have 800 URLs to request. But it takes a long time .I use aiohttp. At this stage, I have received links, by clicking on

Find Binary in a dir of text files Python or Bash

I have a series of log files that are all text. If a certain error happens it results in binary being inserted in the text. I want a Python or Bash script that

Applying own functions

I am trying to apply my own function. Below you can see the data and function. import pandas as pd import numpy as np data_test = { 'sales_201

cv2 magesearch pyautogui need better way to loop thu functions

im looking for a better way to write this code each function searches for the image using cv2 and pyautogui through python-image search. the code works well but

Why is my linked list size function not working as intended?

I used the following code to define my linked list, nodes and a few functions. class node: def __init__(self,node_data): self.__data=node_data

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 to get value from dependent combobox tkinter python?

I'm able to select both the combo box successfully but to print the second dropdown box value, I got lost. Could somebody explain how to print the Table value f

How can I speed up the routing process in OSMNX?

Say I have two taxi orders with Origin1、Destination1 and Origin2、Destination2(O1,O2,D1,D2). I want to calculate the possibility of ridesharing, so

Within a pandas DF, how can I snag last two parts of a list as a single string for conditional output?

I'm doing some modification to a CSV via pandas. For one of the situations, I want to use parse a URL into a list, grab the last two items of that list, and out

Django Form processing files

So I have the following code: # the view class UpdateDateView(LoginRequiredMixin, UpdateView): model = Date form_class = DateForm template_name = '

StringVar.get() doesn't seem to be entirely working (Tkinter)

The relevant code is this: import tkinter as tk from tkinter import ttk import quiz global menu_root def get_question(): question_input = question_respons

Having State names as names instead of numbers Python

I'm trying to have an if statement condition based on state value being equal to a certain value (0,1,2,3 etc.) Is there away to have the condition be with name

Test a decorated function in Python

I have a Python function which is decorated. @retry_if_access_token_expired(app_id) def add_something( self, *, argument1,

how can I use a function as an argument to another function,

I am trying to write a simple code that displays 3 sets of greetings in accordance to what day of the week a user inputs. I am learning about functions as I am

Python Pandas Geopy AttributeError 'NoneType' object has no attribute 'raw' , getting city, state and country from long/lat

I've looked around for a solution and tried filtering my df to where the longitude and latitude are not null but to no avail. This is my first time using geopy

How to draw button or widget upon QWidget using python-MPV on windows?

I use this library https://github.com/jaseg/python-mpv and PySide6 to embed MPV in container (QWidget) in python. I want to draw the button (or something else m

Add Django Rest Framework Login Button to Browsable API when Using Third Party Auth Library (django-rest-knox)

The login button is missing from my browsable API. I am using django-rest-knox for token authentication. My urls.py contains: urlpatterns = [ path('admin/',

How to Select cities from drop down while booking tickets using robot framework

I am new to robot framework and i tried to automate booking sites and when i tried to select cities from Yatra.com website but unable to select cities and dates

String-join pandas dataframe colums and skip nan values

I'm trying to join column values into new column but I want to skip nan values: df['col'] = 'df['col1'].map(str) + ',' + df['col2'].map(str) + ',' + df['col3'].

How can I detect long mouse clicks with tkinter?

I want to detect a long mouse click using tkinter. How can I do that? The <Button-1> doesn't help at all.