Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 23390 articles
Browse latest View live
↧

How to remove image background using rembg?

This is the app.py file for my Python app:from typing import Unionfrom fastapi import FastAPI, File, UploadFilefrom rembg import removeimport requestsfrom io import BytesIOapp =...

View Article


What is the Rust reqwest equivalent of the following Python requests code?

I am trying to do a Basic Authentication GET, ignoring certificate validation, using reqwests.I have following Python requests code, which works:import requestsfrom requests.auth import...

View Article


Vim : Moving Through Code

I want to be able to navigate the cursor across functions using Vim. Mainly, I want a command to allow me to go to the next function, like } allows me to go to the next paragraph. I found this:Go to...

View Article

why ModuleNotFoundError: No module named 'qiskit.opflow' occured?

i installed version 1.1 of qiskit. i don't have any idea why i can't able to use opflow module.this is the line i have error from qiskit.opflow import Gradient, StateFn, CircuitStateFn, Zand this error...

View Article

Scipy solve_ivp requests time out of bounds

My code solves a 1st order differential equation using Scipy's solve_ivp function and the standard RK45 solver. The code itself is reasonably large, and I will certainly attempt to produce a minimal...

View Article


Handling C2016 error on Windows using Visual Studio Code

I have to use someone else's C header files, which include empty structs. I have no control over these headers or I would change them as empty structs are not conventional C. The structs are throwing...

View Article

Reading x_t parasolid file programatically (preferably in Python)

We are dealing with many x_t parasolid files (https://en.wikipedia.org/wiki/Parasolid).We are able to open them in a GUI application, but we are looking for a way to handle them programatically. We are...

View Article

Image may be NSFW.
Clik here to view.

How to create nested list columns in polars

Using group_by() and nest() I can create list columns in R that are very useful for fitting models to multiple datasets.How can I achieve the same outcome in polars in Python, such that each element of...

View Article


Image may be NSFW.
Clik here to view.

Odoo v15 Qweb Report Date_Format and configuration Adding more spaces (%m -...

i triedcontext_timestamp(datetime.datetime.(page['date'].)).strftime('%m - %d - %Y')but the maximum space is only 1 it will not fit on the bank check format which needs 2 spaces between numbers("date")...

View Article


Error while receiving message: Can't parse entities: character '.' is...

I'm working on a Python script that sends messages using Telegram's API. I encountered an error when sending a message that includes the '.' character. The error message is:Error while receiving...

View Article

What can I do if I want to turn the second element in a sublist into a float,...

Here is an example of a list of lists.[["Amber", "7.3"], ["Molly", "14.5"], ["Lisa"]]As you can see, there are two lists that have a second element. These elements are strings but need to be converted...

View Article

Python RSA Encryption - Using Private Key to Encrypt and Public to Decrypt

I am working on creating a license key validation server that unlocks a piece of software. The C++ framework I am using, for the client, has built in functionality that allows the server to send back a...

View Article

SimPy: Strange transient level attribute values of Container resource

I am experimenting with SimPy and I try to monitor the level of a Container resource.For illustration purposes, please consider the simple example of a producer process that produces an item every 3...

View Article


Set the DATABASE_URL environment variable

I am trying to create my own kind of project structure by looking at two scoops of django. The project structure looks something like this .envs.local .django .postgres.production .django .postgresin...

View Article

Getting 'TBE_EPHEM_CREDS_ADDR' after attempting to connect to Google Drive...

Changed my runtime to local due to constantly running out of computing blocks in Google Colab subscription, and decided to use the Local Runtime with GPU usage. Loaded all the files that were mentioned...

View Article


Middleware Metadata Service - Google App Engine

I have the following sync service which is creating an error on a meta dataservice. Can I ask for help interpreting this? What is the meta dataservice? Is there a link to what this is doing? The error...

View Article

How can I format date in Odoo 15 QWeb report? i want to format specific date...

How can I format date in Odoo 15 Account Pay check form? for not using the actual date and not changing into the language date format? please...

View Article


Is there a a compact f-string expression for printing non-str object with...

f-string allows a very compact expression for printing str objects with spacing like so:a = "Hello"print(f'{a=:>20}')a= HelloIs there a way to do the same for other objects like so:from pathlib...

View Article

Python float to int conversion [duplicate]

Basically, I'm converting a float to an int, but I don't always have the expected value.Here's the code I'm executing:x = 2.51print("--------- 251.0")y = 251.0print(y)print(int(y))print("--------- 2.51...

View Article

Image may be NSFW.
Clik here to view.

openpyxl particle size distribution linechart

How can I plot such a graph using openpyxl?X axis should be in log, Y axis in linear. I also want to keep 1, 10, 100, 1000 and 10000 in the X-axis as constant axis tick labels.I tried using a data...

View Article
Browsing all 23390 articles
Browse latest View live