Category "python"

How to install PyQt5 on M1 arm64 architecture?

I have an M1 mac, but I've noticed that whenever native python is running any automation script (like PyAutoGui) it progressively gets slower and slower, almost

PySimpleGuiWeb change ip address

I have a python script that uses PySimpleGuiWeb. I want to host it on my server and connect to it from another computer. But the script is running on 127.0.0.1.

flask-security-too with peewee + mysql not working

After beating my head against the wall for a bit, I've decided I need help from the gurus here on stackoverflow. It's very possible I'm missing something incre

How to compile a py file from another py file by using a module ? (Therefore not Cmd)

I want to make a code (that I'll call compiler.py), that'll compile any py file I need without using cmd commands, only modules(Things that are compilable So I

Using try except in a function

I'm trying to figure out how to get try/except to work within a function. Here is what I have now and it produces a traceback error when I enter anything not nu

Importing Utils in Python

I have Python 3.9.7 and I have already installed utils==1.0.1. So now I want to import this library and trying with this command from . import utils But this

How to get rid of sqlalchemy.exc.NoReferencedTableError?

Here's some code related to the problem: db_session.py import sqlalchemy as sa import sqlalchemy.orm as orm import sqlalchemy.ext.declarative as dec SqlAlchemy

Intercept specific function invocations using parent/child classes?

I am writing a framework that allows us to intercept certain function invocations so that we can manage them(enforce timeouts and retries, persist return

Watch changes in a file and restart python script

I want to restart a python script(restart.py) whenever some edits a file (test.txt) =====restart.py==== from time import sleep for i in range (1000): print

Why get pip install error, when run docker build on only M1 mac

I'm using Intel and Apple Silicon chip Mac. When I build dockerfile on Intel Mac, it is success. How ever when I build same file on M1 Mac I get This error. #1

Trigger Cloud Storage - Dataflow

I'm starting now and I need some help, I have a custom model that I created using apache beam creating a pipeline that takes the data from a csv file from a fol

Matplotlib PathPatch Colors and Legends not Matching

I have a dataset that is a list of lists. Each list is a category to be plotted as a box plot. Each list has a list of up to 9 components to be plotted into sub

Can't two different nodes point to the same node in a singly linked list?

I'm learning circular singly linked list and trying to learn how to delete the last node. The instructor says, once you link the second last node to the first o

Tensorflow: Create the torch.gather() equivalent in tensorflow

I want to replicate the torch.gather() function in TensorFlow 2.X. I have a Tensor A (shape: [2, 4, 3]) and a corresponding Index-Tensor I (shape: [2,2,3]). Usi

Django multiple distinct values queryset for SQLDB

I'm trying to get a list of results that have distinct x and y values, but I also want to return color along with them. Since I'm using an SQLDB I'm not allowed

Two apparently identical dataclasses are not equal

I've defined the following dataclass: """This module declares the SubtitleItem dataclass.""" import re from dataclasses import dataclass from time_utils impor

mongodb command very slow

I have 3 documents like this: { _id: ObjectId("..."), _details: { _session: ObjectId("example_1"), }, { _id: ObjectId("..."), _details: { _session: Obje

Pandas - combine series with unique values, matching across rows

I'll start by dropping in my code and then explain what I'm trying to accomplish: names = [ 'ABX-B767-200BDSF (767-3A)', 'ABX-B767-200BDSF (DAR 767-3A)'

FastAPI application won't start when importing routers

I'm trying to import some authentication related routers to my main class in a FastAPI project, but if I add this import, the application starts without giving

Tkinter: move scrollbar automatically to the founded item when searching

This is a little replica of my app where I've numerous text widget create with a for loop; I've also create a search entry and option to highlight the context i