Category "python"

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

Place the first value of Column B in Column C if Column A has same names in python pandas with loop [duplicate]

I have the following data set in python, Input I want to bring the first value of Column B that belongs to column Column A for a unique A val

google.colab.drive is unsupported in this environment

I am using Colab instance that is connected to Google Cloud to train a neural model using NVIDIA A100-SXM4-40GB. I want to load my files from my Google Drive bu

pynput events executing twice

def pressLetter(charIn): val = getKeyValue(charIn) PressKey(val) return def KeyboardEvents(): from pynput import keyboard with keyboard.Even

Boolean values list to integer in Python

I'm having trouble with this lambdas syntax. I'm trying to translate a list of booleans to an integer value, but I'm getting an error, I don't understand why.

Matplotlib graph with multiple y axis shows and doesn't save

I am plotting a graph with 3 y axis, and it shows in the plot window of Spyder instead of saving correctly in a folder. The graph saved in a folder is blank. He

Error "Numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject."

I got this error file while following this tutorial: https://www.youtube.com/watch?v=yqkISICHH-U So far I have created a training dataset to feed into Tensorflo

Redirect print and/or logging to Panel

I have made a small application that uses a Rich to show a Live view in several Panels. Is there a way to put standard (or rich) print statements into a particu

ValueError: embedded null byte when opening a file using bytestring Python

I try to open a file (here bytestring is shortened) but get ValueError: embedded null byte My code: file = b'\x03\x04\x14\x00' with open(file) as f: print(

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

Pyfiglet/Python - Print Pyfiglet ASCII in one line

This is my code to print "x t e k k y" whit a cool ASCII font using pyfiglet, but the output always displays in 2 lines, whith gives a bad aestethic, is there a

OSMnx : normalised measure of orientation order

Hi I am trying to calculate the normalised orientation order First calculate the bearings of every edge of the street networking into 36 equal sized bins (repr

Pandas find consecutive ones, column wise

I am having an output data frame like the one below and I wanted to format the output so that I can use it for the further pipeline. Few pointers about the data

I am new to Python and I wonder what is wrong with this code

I am new to Python and I wonder what is wrong with this code, I searched for this,I guess in the end of the make_list function I have to return, and not print()

button shape and text alignment changed after updating

I have recently deleted and re-installed python, kivy, kivymd. Then, my kivy button's shape changed. My MDRaisedButton used to have slightly rounded corners but

How to make null/none count 0 instead?

I have some sqlalchemy that counts rows with the value "3" and then prints out the count. It works fine if the count is 1, 2, 3, etc, but when there are no item

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

I need help to use only 8 out of 10 classes from cifar 10. Normally it loads all 10 classes

I want to perform 8 class classification only and hence need to filter any 8 classes out of 10. Please help. Thank you! Code to load cifar 10 is below #Keras li

Sine fitting using scipy is not returning good fit

trying to fit some sine wave to data i collected. But Amplitude and Frequency are way off. Any suggestions? x=[0,1,3,4,5,6,7,11,12,13,14,15,16,18,20,21,22,24,26