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

How to update code in server in perspective? [closed]

I’m writing code for telegram bot. Now I think, how I can update my code in server without stopping it. What can I do for it? Is it worth looking for solutions to this, or I can do it after uploading...

View Article


Pandas groupby two columns and create a new column based on difference in...

I have a dataframe with creation_timestamps and personal_id's. Each personal_id has one or more application_id's. An application_id can have a bunch of rows, but they all have the same...

View Article


Could not parse LLM output in langchain when I request a specific JSON...

I'm trying to integrate the google search api to my constructed agent where the agent needs to create a specific json structure to a given paragraph. The given paragraph will be tasks that was done by...

View Article

Image may be NSFW.
Clik here to view.

Stylesheet disappears

I have such a problem with Stylesheet. I have three "lamps" displaying the status of the program, they are made from QPushButton in QT Designer. The program flashes these "lamps" during the action. I...

View Article

How to create a conditional string value based on other columns of a dataframe?

Let's say I have a cartesian product dataframe like this:soup = pd.DataFrame(data={'Beets': [ 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2],'Carrots': [ 0, 0, 1, 1, 1,...

View Article


DateTime from CalDav is not UTC [closed]

I don't understand what I'm getting from a search on a CalDav server using python's caldav library.I get an event with start date of this form:datetime.datetime(2024, 2, 13, 7, 30, tzinfo=tzutc())It is...

View Article

No module named soundfile

Whenever I try to import soundfile I get the errorImportError: No module named soundfileI installed pysoundfile seemingly without trouble:$ sudo pip install pysoundfileThe directory...

View Article

OpenCV: Drawing Squares Only in Free Spaces Within Vanning Slots

I'm working on an image processing project using OpenCV in Python where I need to identify free spaces within vanning slots and draw squares only in those free areas.However, I'm encountering some...

View Article


discord.py: importing function from main.py causes asyncio.run() error

I have a discord.py project that has a main.py file that runs client.run(discord_token) and also has two other async functions called get_mongo() and dump_mongo(). I have another file called...

View Article


Multiple ONNX outputs (Get Intermediate layer output for ONNX) in python

How can I export model to ONNX so that I'll get intermediate layers' output as well as the layer? (I've seen a similar question that went unanswered here)Consider I have a model, model. The model is a...

View Article

Flask app not returning response when raising error (python)

I am building a Flask API in Python. When a function inside the API throws an error, the server does not return any response. I have tried using try-except blocks and print statements to debug the...

View Article

c# process command line arguments with multiple arguments and whitespaces

I've got the following code which starts a python script:string firstPath = "C:/User/first folder/filestring secondPath = "C:/User/second folder/filestring args = string.Format("pythonScript.py {0}...

View Article

How to obtain a 2d transformation matrix from two pairs of points?

OpenCV provides:getRotationMatrix2D to get a 2x3 transformation matrix (rotation, scale, shift) defined by center, angle and scalegetAffineTransform to get a 2x3 transformation matrix (rotation, scale,...

View Article


Image may be NSFW.
Clik here to view.

My tkinter app wont change the file it is loading

I am writing a tkinter app in python that is a flash card quiz. It needs to be able to read from a txt file one folder ahead from the python file. In the cide you can change which file is the file...

View Article

How to remove multiple values from a tuple in python

I have a tuple which is an output of a select query. The tuple looks like this:('checkStatus id \n========================= ==================== \nfalse adcs-fddf-sdsd \n', None)I am trying to retrieve...

View Article


Python completely ignores function even though it is called, without showing...

I have a function that is called and it doesn't print out in the first statement. I have even checked via breakpoints where only call (at least should) happens but nothing in the function itself.The...

View Article

How to solve duplicated lists in numpy 1.24?

Now I have a 2-dimensional list which have many duplicated lists in it:sta_list = [[31, 30, 11, 3, 1, 0], [31, 30, 11, 3, 1, 0], [31, 30, 11, 3, 1, 0], ……, [31, 30, 11, 3, 1, 0], [31, 30, 11, 3, 1, 0],...

View Article


Cannot get button element of Website in python

I am using the Selenium api i python and trying to get a button element of a website. The element is this: Chat.My code: button = driver.find_elements(By.CSS_SELECTOR(".flex-grow block w-full...

View Article

How to remove trailing whitespace from jinja template with multiple strings...

I am really struggling on this for some reason and cannot figure this out. I've tried multiple variations with no luck. Basically, I am injecting multiple LDAP endpoints into my nslcd.conf via Jinja2...

View Article

How to extract features from URLs in python?

I have just started work on a classification project which detects phishing websites. I am using uci dataset https://archive.ics.uci.edu/ml/machine-learning-databases/00327/Training%20Dataset.arff.I am...

View Article
Browsing all 13861 articles
Browse latest View live