How to implement spotify recommendations API? [duplicate]
Hello I've been working on this code that filters my top-200 songs on spotify, filters them by genre, then updates a playlist. Everything has been good until here, the problem is I wanted to implement...
View ArticleWhy some .xlsx files are successfully open with openpyxl, but others cannot...
I am using Python 2.7& openpyxl==2.5.11.I want to read .xlsx files using openpyxl. Initially I was testing with files downloaded from Google Drive and everything worked nice.Now, I tried to load...
View ArticleVS Code doesn't open Python virtual environment
I'm using Python 3.13.5 with VS Code 1.102.0 on Ubuntu 24.04.2. With VS Code updates, there were often problems with opening venv environment, but usually reloading VS Code was sufficient to make it...
View ArticleOllama Python Unable to set Client host, httpx.ConnectError
I'm trying to run an instance of ollama Client and set the host. As shown in the documentation Docs I see the code should work, but prociding any host but the OLLAMA_HOST environment variable (or 11434...
View ArticlefindChessboardCorners fails for thermal image
I am trying to get OpenCV-python to recognize a checkerboard pattern from my thermal camera. I couldn't get that working. This is the thermal image and I realize the image is low resolution, but I...
View ArticleHow can I make my customtkinter app render all widgets smoothly at once...
i'm working on a Python application using customtkinter and CTkTable to display a paginated table with dynamic resizing and various widgets (frames, labels, buttons, comboboxes, etc.). The code below...
View ArticleHow to use JSONiq in a python program?
How can I use JSONiq to query JSON objects in a python program running on my PC?I have managed to use JSONiq in a Jupyter Notebook running inside Visual Studio Code, but I'm interested in using JSONiq...
View ArticleCan’t create CNAME DNS record using ldap3 and python
I am trying to create a CNAME DNS record using Python and ldap3. I don’t get any error but it doesn’t create the record in the AD DNS.The code I tried:cname_record = “mycname”a_record = “example”server...
View Article403 Forbidden Error when updating caption track via captions.update
I’m using the Python client library (google-api-python-client) to call captions.update, but I keep getting a 403 forbidden even though I’ve granted all the obvious scopes. I’d appreciate any insight...
View ArticlePython Flask-Uploads Get Upload status/progress bar
I am trying to create a form and upload a file using Flask. The current code that I have saves the file successfully to my local server, but I do not have a way to find the upload status, if I upload a...
View ArticlePython3 dictionary being modified at another trhead does not show changes...
Python version: (3.9, but the same result with python 3.12)The goal was that another thread modified a dictionary and those modifications to be available at the original thread.import multiprocessing...
View ArticlePython unittest - opposite of assertRaises?
I want to write a test to establish that an Exception is not raised in a given circumstance. It's straightforward to test if an Exception is raised...
View ArticleWhy doesn't my program professor.py pass check50? CS50 Python Problem Set 4 -...
I tried everything I could but I couldn't seem to find the issue. When I run my program normally, it gives me the correct output for everything. I cannot understand check50's errorHere are the...
View ArticlePydantic does not validate dict values when assigning an unexpected type to...
I have the question same with linkPydantic does not validate the key/values of dict fieldsfrom typing import Dictfrom pydantic import BaseModelclass TableModel(BaseModel): table: Dict[str,...
View ArticleCan't import moviepy due to missing ffmpex.exe
I was trying to create an application with python using the moviepy library. I installed it using:pip install moviepyI found this from a MoviePy crash-course:# Import everything needed to edit video...
View ArticleDmarketAPI Error receiving orders: 404, {"Code":"Not Found","Message":"Not...
The code automatically retrieves a list of active orders (orders to buy or sell items) from the DMarket platform via their API, and then deletes each of them. It uses your API keys for authorization,...
View ArticleSaving an animated GIF in Pillow
(Python 3.4, PIL 1.1.7, Pillow 2.5.1)I expected this to copy the original GIF.from PIL import Imageim = Image.open(filename)im.save('temp.gif')Instead, it saves the first frame as a still.What am I...
View ArticleParameterizing an entire Pytest session
I'm looking to test a Python module using pytest which uses data from an external git submodule. I want to include an (eventually opt-in) option to test my code against many different versions of this...
View ArticleWhy does Google Drive API return a 403 `storageQuotaExceeded` error for new...
I am encountering a critical, blocking issue with newly created Google Service Accounts that prevents any file creation via the Drive or Sheets APIs. This is happening under my personal Google account...
View ArticleEncoding problem when migrating postgresql database tables to models.py django
When performing table migrationpython manage.py inspectdb > example/models.pyall Cyrillic strings are transposed as a set of unknown characters:'id_шёїюф ∙хую'Encoding of the database server as well...
View ArticleIts not proving me Session Context in PySpark spark1 =...
**I am providing all the pre requsite in vscode IDE to run the pyspark context **I am using jdk 17 and pyspark 3.5, python 3.11%pip install findsparkimport findspark`your text`findspark.init() #...
View ArticleUsing the .find() function in a loop
I was trying to get the last word of the sentence using the .find() method in a loop.My code:sentence = "please write a program which keeps asking the user for words"index = 0substring =...
View ArticleIn-place, strictly In-place, and O(1) space algorithms
How does one categorize an algorithm like this:def foo(arr): # original_len = len(arr) tmp = [] while arr: tmp.append(arr.pop()) while tmp: arr.append(tmp.pop())The definitions get kinda of confusing...
View ArticlePass parameter in include directive
I have n rst files in which I would like to insert a similar text (not code):Hello Earth.orHello Mars.orHello Saturn.My idea is to include in my rst files a common rst file... include:: planet.rstwith...
View ArticlePython hvac implementation to retrieve secrets
I am working at a python sample code for the first time, this is about how to retrieve secrets from Hashicorp Vault secrets manager api; hvac.client.secrets.kv.v2, my code is as follows:# 1. Setup...
View Articleraise Exception("Failed to authenticate the redis creds.") [closed]
python manage.py migrateERROR | {redis_service.py:39 - redis_connection} Authentication required.how to fix this without changing the site package?
View ArticlePerforming Union Operation using Inkscape Extension on 3 Groups But Weird Result
I made an extension to perform union operation on each selected group, but I got a weird result.For example, there are three selected groups of rectangles:After using the extension on them, only the...
View ArticleUsing proxy in playwright python
I'm not sure how proxy is used but I tried something and failed. I got proxy list from this site >> https://www.freeproxylists.net/ After reading the playwright documentation, I feel like this...
View ArticleQFileDialog not closing after file selection
I have a simple function that opens a file dialog using pyqt6 to select a file.The function works, but the dialog hangs after being called and I'm not sure why it's not getting automatically closed...
View ArticleWhy is scrapy's @id selector not working?
Here is the page I'm testing on: https://ai.fmcsa.dot.gov/SMS/Carrier/1031421/BASIC/UnsafeDriving.aspxI'm trying to get this table<table class="scrollable smsEvents public" id="inspectionTable"...
View Article