Category "python"

Unable to upload file with python request

I have a form i want to fill out that contains a file and a few fields. If i do a post with just the fields values enters it works but it doesnt if i include th

Add channels to / edit existing tdms files?

I have a naive question but did not manage to find a clear answer. I have some .tdms files with channels of data. I would like to add additionnal channel of dat

Polars: how to add a column with numerical?

in pandas: df['new'] = a where a is a numerical Series or just a number. while in polars we can add a char df.with_column( [ pl.all(), pl.lit('str'

Why do I keep getting this Attribute Error?

Every time I run my code it pops up the message saying "'ICU' object has no attribute '_name'. Did you mean: 'name'?" I can not figure out how to fix it. I've t

How can I convert a string to dictionary in a manner where I have to extract key and value from same string

I need to convert string to dictionary in a manner for example str1 = "00001000-0009efff : a 00100000-656b2fff : b" Output what I require is dict1 = {'a':['000

Python3 unicode strings with pyobjc

I'm converting a lot of python2 scripts that use pyobjc to python3, and having trouble getting them to work. The problem seems to relate to the Unicode changes

How to run an EXE program in the background and get the outuput in python

I want to run an exe program in the background Let's say the program is httpd.exe I can run it but when I want to get the outupt It get stuck becuase there is n

Choose the rows with special conditions in dataframe

I have a dataframe, I want to choose the rows which their average value for column val1 until val4 is greater than 1 and the number of zeros for the row is not

What's the best way to setup a google smtp server for noreply E-Mails sent from a Python application?

We are currently developing a python program that as part of its functionality sends noreply E-Mails to customers whenever something important happens. For test

Python how to automate to pass yes/no to the remote terminal

I have to run multiple show commands to network devices. by using netmiko connected via ssh to the device and executing multiple commands. some commands are bei

How do you perform an operation on a phrase *only* if it's outside backticks?

E.g. say you have the line: `Here's an example.` And another example. How could you change only the second "example" to uppercase? E.g: `Here's an example.` An

running python script drawing svg image based on html inputs inside flask app

Assuming I've got a flask app I would like to call a python script, which would take the values of some inputs within the page (texts, selects, etc.) and then c

Pandera: Is cell based dataframe data validation possible?

Every row of my dataframe contain a record with a unique key combination. The data validation will be based on the columns and on key combination. For example,

How do I refer back to a kivy app class instance I have created?

from screen_selections import NameSelection from kivy.app import App from kivy.uix.screenmanager import ScreenManager class ScreenManagerApp(App): def __i

how to solve xlsx report data overwrite in odoo

I have a dictionary stored in a list, this dictionary looks like: res = [] if 'depts' in data: for department in self.env['hr.department'].browse(data['dept

FastAPI pagination query response excludes item id and date

I'm trying to implement pagination in my FastAPI-application. I want to display all todo's that a user has added. The problem is that the response I'm getting b

Why isn't my variable accepting all values in my program

I'm making a program that calculates salary by taking in input from a .txt file. It opens it, then runs it through an if/else statement to see where it falls un

Preparing scraped text to mysql database in python

I ran into an issue preparing data for database, since iam doing that very first time I scraped text from html dt and dd tags, so i'am getting a lot of informa

Given a matrix, return a list (or generator) of all it's pairwise-neighbors

Let's say i have this matrix: (doesn't have to be squared) a b c d e f g h i I want to return a list, or a generator, of all it's pairwise-neighbors. Meaning:

Is there a way to get win32 file handle from pipe's C file descriptor (python)?

Searched for about 1 hour and still unable to find any relevant search results. I want to wait on multiple pipes in a single thread, but unable to convert the f