Category "python"

Get a list of all NFTs owned by a solana wallet - Python

Im trying to make a python discord bot which pulls all NFTs owned by a wallet which is input by a user. Going through the solana.py docs it only seems they supp

Merging 2 binary files and read them

I have two files that I want to merge in the same file, and afterwards read them. One is an image with almost all values equals, and hence is only 400 bytes siz

How to make bot run a slash command discord.py

I'm trying to send slash commands with a selfbot ran on repl.it but they are sent as a normal message and not detected as slash commands. I know discord selfbot

Broadcast message to multiple Multiprocessing processes

I have a Multiprocessing application with a bunch of processes, I want the control thread to broadcast a message to multiple processes. If I used a pipe pair fo

Binding keyboard.on_press_key inside a For Loop in Python

I'd like to set up on_press_key binds using Python's Keyboard module through a For loop that's iteration through dictionary items. However, the binds do not see

Why "for i in q" makes the result different from "for i in range(len(q))"?

I have code for calculating max depth using BFS, which works fine, but I couldn't figure out why it fails if I replaced for i in range(len(q)): with for i in q:

how to bmp bytes transfrom to bmpfile

I make a barcode by zint. If it successes it will be creat a bmp file. But I want to its bmpdata. Now I get its bmpdata,I don't konw to show it by pyqt5.Becsuse

Find max value that is multiple of 3 in an array

Recently, I've got a code test from ABC. Please take a look at this one and give me your idea. Find the max value of an array of N integers. E.g. [ 1, -6, 2, 0

How to drop columns and rows with missing values?

I've been trying to take a pandas.Dataframe and drop its rows and columns with missing values simultaneously. While trying to use dropna and applying on both ax

How to resolve the following error in discord.py: "TypeError __init__() missing 1 required keyword-only argument: 'intents'"

I'm using Heroku as my server host of my Discord.py bot, but i am having a problem. the problem is: Traceback (most recent call last): File "test.py", line

How to write excel formula (SUM()) dynamically in a range of columns using openpyxl?

In my Excel spreadsheet I need to enter excel formula on a bottom that will summarize values. Number of rows can be different. But not columns. So in cell B10 s

Split blf-files in Python into smaller files

I'm wondering if it is possible to split BLF-files in Python? I know that there is a library (can) that supports BLF-files, but find no documentation on how to

i want to use the turtle function to write out what i input

i have already made a turtle string to make every letter in the aphabet, and assigned them to functions, so i only have to print a() for it to write out an A fo

Normalise data where every second row is a column header

I have a system where you manually input data, for example data about people. Some fields are mandatory but majority are optional. When the data is outputted it

Can I dynamically generate boolean options on a custom Blender operator?

I'm trying to write a custom operator for Blender that: Gets the objects currently in the scene (may be lots) Filters them based on some criteria Prompts the us

How does "alternates" in the Django sitemap framework work?

I am struggling to get the "alternates" attribute to work in the Django sitemap framework. class StaticViewSitemap(sitemaps.Sitemap): priority = 0.5 cha

Convert date + time strings to epoch milliseconds in dataframe column (when present)

I have a dataframe with a column called "snapshot_timestamp" where the time is in this format: 2022-05-01 23:45:47.428 (year, month, day, hour, minutes, seconds

why didn't my program write some of the fields?

So I wrote a program to write the different attributes like title, total number of comments, total upvotes, post body, author name of submissions in a CSV file.

Why is code for prime numbers not working for the number 10?

I am trying to write a code in python to find all prime numbers of a number. My problem is that with this line of code it does not work to return the prime numb

Send csv file in pytest test using restframework ApiClient

I'm trying to test my view which requires csv_file and one parameter in request, but getting error "details": {"csv_file": ["The submitted data was not a file.