Category "python"

Is there a way to make Entry widgets in tkinter rounded or look nicer?

I code in Python and I use tkinter quite a lot to create GUIs for my applications. I prefer to make my GUIs look round and modern rather than sharp cornered box

Why does utility computation in is_terminal include the # of blanks left in a terminal state? What does mean with performance measure for the agent?

Consider: import numpy as np def actions(state): # Returns the indices of all blank spaces on the board (represented by '.') return [i for i,s in np.nd

Python CV2 video writer doesn't save video

I have a simple python code using OpenCV and Keras that performs some detections on frames (follow-up from my previous question here). But when I want to record

Python CV2 video writer doesn't save video

I have a simple python code using OpenCV and Keras that performs some detections on frames (follow-up from my previous question here). But when I want to record

Dynamic variable names (at runtime) in Python

I predefine some variables and want call them in a for loop: a1 = 10 a2 = 20 for i in range(1, 3): value=("a%s" %i) print(value) And I get a1,a2, but I wa

Drop-down menu is not showing in Combobox tkinter

I'm trying to make a drop-down menu for tkinter gui (Combobox). The code has no errors, but drop-down menu is not working. I'm using PyCharm, macOS. Please see

Inserting Data to SQL Server from a Python Dataframe Quickly

I have been trying to insert data from a dataframe in Python to a table already created in SQL Server. The data frame has 90K rows and wanted the best possible

How to format very small numbers in python?

How to format 1.3435434533e-8 into 1.34e-8 in python? Keep only two digits. The round() method will round this number to zero.

How to change the structure of a an XML in python

From this string : label_config={ "label1": [ "modality1", "modality2", "modality3"], "choice":"single", "required": "true",

How to open up Microsoft Edge using Selenium and Python

I've already added the msedge driver into the path variable. cmd confirmed that MSEdgeDriver was started successfully, however, when I run import os from selen

Is there any way to solve re.sub issue?

sub() missing 1 required positional argument: 'string' def preprocess_text(sentence): #Remove punctuations and numbers sentence = re.sub('[^a-zA-Z]', '

Subprocess loop in python

I have a folder with a few hundred .bed files that I want to loop over to extract fasta sequences. In the terminal, my command is: twoBitToFa -bed=PA2_03_2bit.b

What's the computational complexity of .iloc[] in pandas dataframes?

I'm trying to understand what's the execution complexity of the iloc function in pandas. I read the following Stack Exchange thread (Pandas DataFrame search is

Change many2many field tags color odoo

How i can chage color, for tag in my many2many field. example:

Python PyQt update GUI

basically I am having trouble with Updating my new GUI. Windows 10 | Python 3.8 | PyQt5 I got a class like class My_GUI(): def __init__(self): ..

How to avoid excessive ram consumption using pathos

This is a rough example of how I leverage multiprocessing with pathos: from pathos.multiprocessing import ProcessingPool pool = ProcessingPool(10) results = po

Skipping certain amount of cells if a condition is true in a for loop (Python)

I'm trying to tell python to insert "No work" in certain amount of cells, depending on how many days has passed since the codes was run. So basically, let imagi

Tkinter unable to configure

I have this problem when I try to run an app that imports turtle: Traceback (most recent call last): File "/home/panos/Documents/python/challenge_60.py", line

How to check if there's a tuple inside a list?

Why does this: seq = [(1, 2), (3, 4), (5, 6)] print(() in seq) return False? How can I check if there's a tuple, or even a generic sequence, inside a sequenc

How can I compare the contents of two text files in python

Hello i need to write a script like a wrote in title so i want to give an example for what i want : file1.txt's content: New York Los Angeles Miami file2.txt's