Category "python-3.x"

socket.timeout on telegram bot.polling()

When I leave my program running for a few hours and then send a message to the bot it doesn't reply and after a while it generates the following error. Tracebac

when i use docker-compose to install a fastapi project, i got AssertionError:

when I use docker-compose to install a fastapi project, I got AssertionError: jinja2 must be installed to use Jinja2Templates but when I use env to install it,

Airflow without sudo access?

in my virtual env on azure VM, i ran pip3 install apache-airflow when i started airflow db init i received File "/home/shivamanand/myenv/lib/python3.7/site-pack

Dynamically adding a row in data table Kivy/KivyMD

For example I have an empty data table (with only column data) and a button. I want to dynamically add row data when button is pressed. Is it even possible?

Python arrow get list of years between date range

I have this function: def function(start_date_arrow=None,end_date_arrow=None, date_concept=None): list=[getattr(date, date_concept) for date in arrow.Arrow.

Encountering divide by zero after a conditional preventing this

I am writing a simple piece of code for a physics assignment where we are supposed to model a water molecule as a collection of charged particles. I am supposed

How to apply a pandas geocode function to Pyspark column

Table is like this id ADDRESS 0 6101 SUMMITVIEW AVE STE 200 YAKIMA 1 527 CEDAR WAY SUITE 105 OAKMONT 2 1700 N ROSE AVE SUITE 460 OXNARD 3 1275 YORK AVE NEW YOR

discord one script run multiple times

Friends, I am making a discord script using python I have to run this script multiple times with different parameters, I am trying that with os, threading, mult

pytest can't find module for tests

I have a structure like (not exact names) - my_project - app - repo - __init__.py - my_repo.py - services - __init__.py

Trying to read __version__ with setuptools (setup.py) results in FileNotFoundError during build

EDIT: See answer below for explanation of my mistake, and the solution. I was trying to follow the instructions in @dnozay's answer on how to read __version__ i

'Access is denied' to Python 3.8 for PyCharm on Windows 10

Attempting to create a new project in PyCharm Community on Windows 10. Here are the settings for new project in PyCharm: I'm greeted with the error msg: Cannot

problems with """input().split() in loop""" in python

n, m, k, r = tuple([int(i) for i in input().split()]) roads = [] for road in range(m): t = tuple(list(map(int, input().split()))) roads.append(t) pri

FastText 0.9.2 - why is recall 'nan'?

I trained a supervised model in FastText using the Python interface and I'm getting weird results for precision and recall. First, I trained a model: model = fa

How to analyze/retrieve link details?

I'm trying to retrieve the URL details after I enter it. When I go to this URL https://entropystream.live/PLAIDARMY it is going to be reversed into this https:/

How keep tracking the external program opened in python?

I want open a program (ex: calculator) and keep tracking his process as the pid, name, etc. But, after calling the subprocess.Popen(), the process id is killed

Variable not being assigned and called correctly

I am trying to get a picture from my files to print after the user input a number for PokeID in the interactive manual. But when the number is entered it does n

`pyusb` fails to find `libusb` when using `pyinstaller`

Problem My application works well when in python-only and on my machine. I am attempting to deploy to a machine which has lesser privileges. The basic script t

Django model default value in response

I want to have a default value in my django model response value Sample model query myModel.objects.filter().values("username", "user_gender") I want to have a

How to get the values of dictionary python?

I have the below python dictionary stored as dictPython { "paging": {"count": 10, "start": 0, "links": []}, "elements": [ { "organiz

The contour detected using opencv to dxf

I used opencv to detect contours in Python. I wrote the code for saving this contour as a dxf file as below through a search. cap = EasyPySpin.VideoCapture(0)