Category "python"

Tkinter Button That Stops Thread

I'm trying to make a discord bot that I can start and stop using tkinter. I have a tkinter button that runs a thread which turns on the bot and since I have a s

How to see what can be set/updated on an issue?

I'm trying to use the JIRA Python API to create and update issues on different projects. Currently I'm after timetracking but I've seen other fields that cannot

How to decrease the space between grouped bar-subplots in matplotlib?

import matplotlib import matplotlib.pyplot as plt import numpy as np a_means, a_CI = (70, 60), (2.7, 1.9) b_means, b_CI = (85, 83), (2.6, 1.2) c_means, c_CI =

ResourceExhaustedError: Exception encountered when calling layer "batch_normalization_10" (type BatchNormalization)

When I run a transformer code for video prediction, the code itself should be correct but an error occured: ResourceExhaustedError: Exception encountered when c

Import a python property in other file python

py like this class MyStack(core.Stack): def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, c

How can I dynamically split the text based on multiple sub-titles in a given text for every new text?

I have an original text that looks like this: We are AMS. We are a global total workforce solutions firm; we enable organisations to thrive in an age of constan

pywinauto not see some button in dialog

Its can't find button Setup -> Load Option My apps screen I has that code import time from pywinauto import application app = application.Appl

Pandas internals - "Index labels must be unique"

The Pandas Internals documentation (v1.2.4) states In pandas there are a few objects implemented which can serve as valid containers for the axis labels: Index

Iterate Naive Bayes classifier over a list of strings

This is an NLP question that hopefully someone can help me with. Specifically trying to do sentiment analysis. I have a Naive Bayes classifier that has been tra

How to retrieve the first added node when a LinkedList is created?

I have created a linkedlist in Python using below classes: class: Node class Node: def __init__(self, data): self.data = data self.next = No

Pass parameter name to a function in python

Thank you for your time reading this question. I want to use an existing function through a PIPELINE. I want to give the name of the parameter into that pipelin

Python SQL Insert script

I'm creating a Python script to insert some records in a table, but have the following problem: INSERT INTO orders VALUES (7656940929251, "ADIDAS | KID'S STAN

Can't get user input to append to a file

So I'm trying to use the command file.write(newItem + "\n") to append text to a file but I'm having a problem. So here is my code: file=open("devices.txt","a")

Python Twitter Bot Main Files not running all functions

I created an automatic Twitter bot with a group of friends during my university's Hackathon. As a new Python developer, I came across an issue where certain fun

How can I specify a generic MutableSet, that demands existence of a update method, in a typed signature (Python >3.9)?

I have written a library. Some of its functions and methods operate on sets of Hashables, e.g.: def some_function(my_set: set[Hashable]) -> None: ...

Branching out a function

I've built a function that tries to extract some information from a string. Before: function (string) Now, I want to refactor that function by receiving two ext

mypy fails for numpy sum

This code snippet works: py -c "import numpy; print(numpy.array([[1,2,3],[4,5,6]]).sum(axis=0) % 2)" [1 1 1] But mypy gives an error: py -m mypy -c "import num

How to ensure that the labels of two axes do not overlap?

I have some questions about labels of axs. Firstly,I have 2 subplots which can be seen below. As you can see, labels of first ax are overlapping with the second

Is it possible to have input from one device populate one field in tkinter, and another device that populates a different field?

I have a keyboard and a USB bar scanner and two separate monitors at different locations all connected to the same computer. I want the keyboard to enter data o

Optimization and objective function using Scipy

I am trying to optimize an objective function using scipy. I simplified what I would like to do to focus on the problem more. There is an array called operating