Category "python"

Contents of a Tkinter table unable to be deleted

I'm currently trying to display a table in tkinter that refreshed every time the user switches frames. The way that I am doing this is through deleting all the

BitBlt | StretchBlt - Access is denied when the user is not logged in to Windows

I have a python program that uses simple Windows GDI functions like BitBlt and StretchBlt which runs at computer startup but it starts before the user has logge

Convert txt file, with variable categories, to dictionary and pandas df

I've converted a txt file that has a fixed number of variables, for every entry, to a dict and df. For example, if every entry in the txt file has a Date entry

Loss exploding while training CNN despite small learning rate

I have been working with synthetically produced data which consists of samples of the shape 4x1745 and 2 labels each of which further can have 120 classes. The

Selenium turning off on redirection problem

I have a problem with my selenium script. Basicly what is it supposed to do is click an element that redirects you to a completly different page (url and everyt

How exactly does discord.CommandPermission work?

I try to gray out some slash commands that only someone with the right permissions can use. I found out that you can gray them out for everyone if you set defau

I got formatting type error but I don't know why this happen

#35 name1 = "eric" age1 = 10 name2 = "jay" age2 = 13 print('name:',name1,'age:','%d','\n'+'name:',name2,'age:','%d' % (age1,age2)) I got an error which is this

Iterating through rows in a dataframe

I have a dataframe of 12 different teams with their own statistics. My objective is to repeat an entire series of steps for one team, and so on, until the last

If statement getting Skipped in a Function

I have defined a function that takes three entries, 2 numbers and an array. The Array is a 800 row 10 col array. The first column in the array has a number for

Scrapy symbol replace

I try to delete symsol ":" from dates and it doesn't work: oper_dates=response.css('.textonline__date::text').extract() for item in oper_dates: clean_oper

Django user authentication fails in selenium tests

I'm writing tests for my djangocms app, first time using selenium to replicate the browser/user. I'm trying to test the login page, user simply fills out the us

What is the syntax for writing txt file with multiple numpy arrays+scalars and how to read it in again?

I have 2 numpy arrays of same length lets call them A and B and 2 scalar values named C and D. I want to store these values into a single txt file. I thought of

What's the difference between `raw_input()` and `input()` in Python 3?

What is the difference between raw_input() and input() in Python 3?

Should you always add list.copy() / dict.copy() when passing a list/dict to a function?

I had a painful experience today that I accidentally passed a list to a function, and took me ages to debug. The function was meant to take in a list and create

Get MRR from Stripe API

I'm trying to build a dashboard to view Stripe data (MRR, daily revenue, etc.) alongside usage metrics. I can't seem to figure out a way to pull MRR, revenue, e

Registry query not working with subprocess command

When I enter this in my CMD, it works fine: reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v BackupProductKeyDefault

Why do I get a Conv2D error trying to run Conv1D layer?

I am trying to write a simple 1 dimensional convolution with a regression (1 dimensional float) output. model = Sequential() model.add(Conv1D(filters=1, kernel_

How to verify an email in python without sending an email by verifying records?

import smtplib, ssl import dns.resolver,socket smtp_server= 'smtp.gmail.com' port = 465 sender = '[email protected]' pssword = '' addressToVerify = 'raghavareddy

Issue doing greedy search using Python

This is my input text: "you have a choice between 1, 2 or 3 bedrooms" I want to get the number of bedrooms, so one or more numbers before "bedroom" (allowing: '

Behavior of Python subprocess on django+nginx

I have a simple code like: subprocess.run( ["python3", "action.py", "--options"] ) In action.py I import some packages, perform a small script It