Category "python"

PRAW Posting new submission with a flair?

Trying to post to a subreddit that requires flairs reddit.subreddit('test').submit(title,url=link,flair_id='') i didn't know how to find the flair_id of a subr

twisted.internet.error.ReactorAlreadyInstalledError: reactor already installed

I am having this error when I run a crawl process multiples times. I am using scrapy 2.6 This is my code: from scrapy.crawler import CrawlerProcess from footbal

Command 'Python: Select Interpreter' resulted in an error (command 'python.setInterpreter' not found)

I have been using VSCode for a while and so far everything was good. Yesterday I created a new django project with it's own virtual environment. However, someth

Django admin: section in app without creating a model

I need a custom section of application on admin site. It must not consider any model (proxy, unmanaged, etc), without template overriding, just a "phantom" appl

Django digital ocean droplet isn't showing the website when connected with a namecheap domain

So I'm using a Django Digital Ocean droplet to run a website. I recently tried connecting the IP address of the droplet to a namecheap domain name, but when I c

AttributeError: 'NoneType' object has no attribute 'strip' - Scrapy doesn't crawl all the elements

My spider doesn't crawl all the elements. As I can see now, one of the errors is an attribute error which I don't know how to fix it. This is a non-English webs

Locust - Python - ssl.SSLError: [SSL] PEM lib (_ssl.c:4065)

I am new to python and locust, trying to run my first locust perf script to test an API However, I am getting error as ssl.SSLError: [SSL] PEM lib (_ssl.c:4065

PDF from a histogram in zfit?

I looking in the documentation how to obtain a PDF from a histogram, but I couldn't find anything, so how can I obtain PDF from a histogram ?, for example to us

Is there a way to send messages to every member on a discord server? (discord.py)

So, I want to send a message to everyone on a discord server, except one. How can I do it? Because, with my code it checks if it's that user over and over. (and

How can I return a sorted list of integers here? [closed]

def pairs (x): i = 0 z = [] while i < len(x)-1: if x[i] == x[i+1]: z.append(x[i]) i+=1

Add new element under specific element category in xml using python

Edit 2: It seems I got the persistance of the changes wrong. It will simply record the new elements for the last record in the csv file. How do I keep the added

Discord Error 403 error code: 50001 Missing Access

when i run python3.9 -m ctbot i got this error, and the slash command will not be updated. after i kicked my bot and reinvited my bot to my server, the slash co

Heroku / Redis Connection error on Python/Django Project

I'm trying to set up django so it send automatic email when a certain date in my models i reached. However i setup a Heroku-Redis server and am trying to connec

Facebook Group Post Scraping Using Selenium Only Returns One Post

I'm in the process of building a Facebook Group Scraper, I have managed to write the code to log-in + scrape the name of the, but for some reason, my code is on

Adding new column based on combined criteria in Pandas Groupby

Following on from my previous question (thanks to those responding) I'm stuck again in achieving what I suspect is possible using a groupby in Pandas. Here's wh

What in this python program can make my memory goes to sky and freeze the program?

I have written a python program that connect to my mqtt server and process the data! BUt the memory start very low and get higher and higher over time! I would

Python - Compare values in multiple rows and columns

I am new to Python, and I have a dataframe looks like below (see the raw data table). The ultimate goal is to reconcile records (ie. id, rg, prd, and amount) fr

Instantiate Keras model with some weights before training

I have Keras model: pre-trained CV model + a few added layers on top I would want to be able to do model.predict before model.fit Q: how do I instantiate model

How to create unit test for a Python Telegram Bot

I've built this Telegram Bot in Python, with python-telegram-bot. It's not so complex, but I want to do some regression tests to check if everything works fine

How to make Dropdown with input field in django form

I am a noob to django and python 😥 I have a django form, it needs a dropdown menu with input field to enter the text which is not listed in dropdown. Is