Category "python"

Not Implemented Error in Django Channels Layers

I was following the Django channels tutorial to create a simple chat application. But while trying to check if the channel layer can connect to Redis, I get thi

pyautogui, locate on screen doen't work in linux

I am using linux, and it returns none instead of the co-ordinates. import pyautogui as p a=p.locateCenterOnScreen('like.png',confidence=.5) print(a) Did I di

ORTools CP-SAT Solver. Constraint to require two lists of variables to be drawn from the same set of integers

I have two lists of variables M and T. I would like to create a constraint where the set of unique values between M and T are identical. From the solution varia

django removes "is_staff" permission if I try to login

I have a pretty strange situation within my django project. I have a LoginForm where a user can log into the website. I am using django 3.2.12 with some other l

How to create xpath that matches both conditions present in an element?

Description: I need to create an Xpath that matches both the condition present in the div class = 'item_inside' Explanation: Imagine There are two item_inside c

Implementing a search query inside a filter

I've been trying to implement a search bar inside my application, but I don't know how to query for similar names inside my db. Here is my view.py queryprms

How to validate a file starts with certain perfix format?

I have a list of files with names like this. ["TYBN-220422-257172171.txt", "TYBN-120522-257172174.txt", "TYBN-320422-657172171.txt", "TYBN-220622-237172174.txt

How to check for network security config with Androguard in python script

I have an .apk file and want to check wheter the res/xml/network_security_config.xml [1] trusts user supplied certificates. I read into the androguard docuemnta

ModuleNotFoundError: No module named 'telebot' on heroku

This is the official document https://github.com/python-telegram-bot/python-telegram-bot. How do I using pip install python-telegram-bot --upgrade on heroku. Th

Debug Toolbar not showing

I installed: pip install django-debug-toolbar I have DEBUG=True in my settings I have django.contrib.staticfiles and debug_toolbar in INSTALLED_APPS i have STAT

Try Except is just executing all lines simultaneously (in pyolite kernel with `input()`)

I'm "learning" Python in a course on Coursera, but this lesson doesn't have any explanation and doesn't seem to work at all. As I'm so new, I have no idea what

Why do I need to override the handle_data method in my own class?

Why do I need to override the handle_data() method when it already exists in the library here: https://docs.python.org/3/library/html.parser.html#html.parser.HT

Graph not being displayed on django framework

I want to display a graph using C3 Javascript library which displays future prices of textile raw materials on django framework. When I run the code it does not

Flask Unique SQLAlchemy with Flask-LImiter

I want to make a project with flask where you sign up and sign in and then you can make new posts. I use flask-limiter to prevent users from making new posts. A

WHY tf.keras.layers.Conv2D gives different results at each run

I am trying to reproduce my code from online Jupyter Notebook (COURSERA) to my own local environment (Anaconda 3 Jupyter with CUDA installed) All Codes a

Compare 2 columns in excel using python

Hello I have an excel file (.xlsx) with 2 columns of data I want to compare the rows in column A with column B and output the value of column B in another gener

Trigger A Python Script By Using JavaScript

I am doing a little project where i have prepared the back end in python and the graphic user interface woth HTML, CSS & JS. The python script doesn't requi

Azure Function App running old code when deployments are successful

My Linux Python function app is refusing to run the most recent code deployed to it. I've tried deploying via Visual studio code and GitHub which does work as I

Trigger A Python Script By Using JavaScript

I am doing a little project where i have prepared the back end in python and the graphic user interface woth HTML, CSS & JS. The python script doesn't requi

How to insert this values into the database properly?

I have a file name log.txt It's structure it's kind of like this: 2022-04-28 22:33:02,290\\INFO\\Database connection established 2022-04-28 22:33:07,470\\INFO\\