Category "python-3.x"

Rounded corners not shown for QPushButton in Qt Designer

I want to the corners to be rounded and hover for a QPushButton in Qt designer. Changing the style sheet has no effect. What am doing wrong? QPushButton#pus

Having issues to import imblearn python package on Jupyter notebook on Anaconda

I wanted to install imbalanced-learn using pip install imbalanced-learn. Then I have tried import from imblearn.ensemble import EasyEnsembleClassifier This imp

Output of LaTeX symbols using f-strings

Please bear with me, as I don't quite understand the possible and impossible uses of f-strings. Take the code: pi = 3.14159265 print(f'pi on 2 decimals is: {pi:

How to plot data from UDP stream coming from F1 2019 game, my lineplot comes up blank

I have this below code in which I am getting data packets from UDP from the game. However, when running this code I am getting a blank plot, I want to plot Spee

Minimum and maximum sums from a list Python

I've been doing problems on HackerRank to get my foot in the door for solving Python problems and while I've had fun working through a few, one problem is stump

Filter lines having text portions embedded either between - or * in PYTHON 3 using regex

string1 = ''' The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is bette

import _tkinter # If this fails your Python may not be configured for Tk error in python 3.8

Currently using Ubuntu 20.04 LTS with python3.8.5. Its my first time using ubuntu with absolutely no previous knowledge of terminal.SO,would love to have a deta

How to identify whether website is accessed from same hosted server or different client machine

We have a website hosted in local intranet environment using Python webserver. In that website particular button should only be visible if user is accessing thi

Installation of py3exiv2 fails on MBP M1, macOS Big Sur | InstallationError: No .egg-info directory found in

Installation of py3exiv2 (using pip) on my MacBook Pro M1 fails, with the InstallationError: No .egg-info directory found in... error. I have tried the solution

How to read/extract contents of .tar.7z file using python

I have a .tar.7z file which I want to unpack (when I unpack with archive_utility.app on MAC manually, I am getting a folder with subfolder and files). I am not

Creating universal build for mac os with pyinstaller and python3

I have two mac machines. One is intel based and running big sur and second is M1 and running big sur. I am trying to build a sample hello world package using py

How to add a new row after every unique entries in pandas dataframe

I have to add a new row at the end of each person information. In the new row which we will add all the information will be same as last row like name, last_upd

Eigenvectors in Julia vs Numpy

I'm currently working to diagonalize a 5000x5000 Hermitian matrix, and I find that when I use Julia's eigen function in the LinearAlgebra module, which produces

Filling contour won't work using drawContours() thickness=-1 [duplicate]

I am trying to fill a contour which was obtained by separately thresholding 3 color channels. image_original = cv2.imread(original_image_pat

How can I store a userid and password in SQLite database from my python application?

I'm not a pro in python, I just have a username and password stored statically in my python config file, the app use this credentials to FTP some files. I canno

Why is the error "Cannot use HTMLSession within an existing event loop. Use AsyncHTMLSession instead"?

I'm running the code provided by @Dan-Dev in his answer. from requests_html import HTMLSession url = 'https://www.thefreedictionary.com/love' session = HTMLSes

python websocket pub-sub with re-publish/broadcast

I would like to set-up a server that can subscribe to an external stream over a websocket (ws_ext) and then republish that data (after curating) to internal cli

Python: appending numpy.array to list python overwrites the previous elements

I'm trying to plot a stellar orbit in a given potential. First, I initialize the position and velocity, and derive the acceleration from the position according

Unable to delete PowerPoint Slides using Python-pptx

I am trying to delete PowerPoint slides containing a specific keywords using Python-pptx. If the keyword is present anywhere in the slide then that slide will b

how to use re.sub to replace matches with a series of numbers

I'm trying to remove all HTML tags from a text file and after some processing on the text , I have to put the HTML tags back in the text, So i thought maybe rep