Category "python"

Images with Firebase and Python Flask API

I am currently developing an API using Firebase from google and Python's Flask libraries. It is a proyect where I am in need of saving images to the DB and then

How can i create a google sheet inside a google drive folder

how to create a google sheet and placing it in a specific google drive folder? file_metadata = { 'name': 'Invoices', 'mimeType': 'application/vnd.google

python list ofwords.the program outputsthosewords&theirfrequencies.Ex:if the input is:hey hi Mark hi mark the output is: hey 1 hi 2 Mark 2 hi 2 mark 2

I thought I could use this code: wordInput = input() myList = wordInput.split(" ") for i in myList: print(i,myList.count(i)) but its output is: hey 1 Hi

"Core Dump" analogue for Python scripts?

Say, my script runs on server and has failed at some moment of time. Except for the error messages in the logs - I would like to have some image file on server

how do you convert a list into a int in python in one/two lines?

If you want to convert a list into a int You could use x = "" the_list = [5,7,8,6] for integer in the_list: x+=str(integer) ans = int(x) #output 5786 is

Every object's attribute update when I just want one

When making objects of a certain class, I give them a matrix as an attribute and store these objects in a different class, however when I change this matrix for

How to convert a array of string to array of float using

I have a array as shown below, in that I am having a variable called f, I need to assign the some value for this variable f say 2 and convert this into a floati

mock queryset in Django unittest

I have sample code and test: def outer(): inner_response = inner(param1) def inner(something): queryset_response = something.object.filter(foo="bar",

python screengrab problem (on yolov5, pytorch)

im trying to get a screenshot of a window as fast and then inference on yolov5 it works but sometimes it doesnt detect very well compared to using detect.py on

Install Django on Gandi instance

I am trying to install an Django app on Gandi. For now, what I have is un file name wsgi.py: import sys import os import os.path sys.path.insert(0, os.path.abs

How to use Gridsearchcv to tune BaseEstimators within AdaBoostClassifier

from sklearn.svm import SVC from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import GridSearchCV from sklearn.ensemble import AdaBoo

How to make a chatbot for discord using python

I need advise and/or resources to make a chatbot for discord in python, i have some knowledge of python and the discord api but I know nothing about chat bots o

AWS Glue - IllegalArgumentException: Duplicate value for path

I have a messy data source where some field values can come in with two different names but should map to one conformed field name on the output. e.g. data sour

Recursion python - counting vowels in a string

The following code is from geeks for geeks - link When I executed to visualize the code line by line on pythontutor.com, I understand that n is being reduced to

How can I create a launch.json to use pipenv scripts?

I have the following folder structure in a monorepo repository /--.vscode /--Services --/Service1 --/Service2 --/Service3 In each service, I am using pip

Problems with pip und Command line

I am trying to create a Python pip package. This works also well. I can successfully upload and download the package and use it in the Python code. What I can't

How can I create a launch.json to use pipenv scripts?

I have the following folder structure in a monorepo repository /--.vscode /--Services --/Service1 --/Service2 --/Service3 In each service, I am using pip

IndexError: list index out of range with api

all_currencies = currency_api('latest', 'currencies') # {'eur': 'Euro', 'usd': 'United States dollar', ...} all_currencies.pop('brl') qtd_moedas = len(all_curr

IndexError: list index out of range with api

all_currencies = currency_api('latest', 'currencies') # {'eur': 'Euro', 'usd': 'United States dollar', ...} all_currencies.pop('brl') qtd_moedas = len(all_curr

Return does not return information

When wanting to return a value with the return and wanting to use it later in a variable, nothing is returned to me. #Actualizacion de informacion def messageHa