Category "python-3.x"

Last number of iterator in python

How to edit the iterator giving also the last number in the sequence, please? I mean in general, not for such an easy sequence. Using < instead of == is not

how to add type hint for function return something I don't Know

How Can I add type hint for conn.cursor()? class DBManager: def connect(self, dbname:str, user:str, password:str): """Create Connection to the Postgre da

Given a graph, program that presents, in alphabetical order, the probable friends

I'm a beginner in python, I'm having trouble solving an exercise on graph, the exercise is as follows: Given a graph representing the social network's relations

How to receive a json response using proxycrawl

from proxycrawl import CrawlingAPI from bs4 import BeautifulSoup api = CrawlingAPI({'token': 'wMtzOpKeL9CCASWQBGiRLA'}) # a = """GET 'https://api.proxycrawl.com

How to traverse a matrix in a spiral fashion in C using pointers?

This is the algorithm for traversing a matrix in spiral fashion and printing the traversal as an array in Python: def spiralTraverse(array): result = []

Airflow API call returning 400 when clearing and rerunning a task

I am setting up an Airflow environment which runs few databricks notebooks. I have setup a create_cluster task using PythonOperator which creates a cluster, Pro

Is there any way to crawl the proseries basic application using python

Proseries Basic Evaluation is an application to load the the client files. I need to crawl and automatically client the create new clients.

malformed node or string on line 1: <ast.BinOp object at 0x10f5c5f00> when remove ' of words in python3

I want to remove the start ' and end ' of a string in Python 3, this is how I do it: new_words = ast.literal_eval(str(words)) but when the content is W/"128d6f

WebDriverException: 'css selector' is not valid or implemented searching strategy error in automation of windows application using Winium

I'm new to the winium and trying to automate the process. every time i run the code im getting an error: WebDriverException: 'css selector' is not valid or impl

Scrapy with Python in Visual Studio Code

Hello to all the community! I'm training in Python (DAW + Web Scraping). I am currently trying to run my code but, the problem I "see" is that the .csv comes ou

Trigger Selenium Automation scripts with gitlab CI/CD

I am trying to trigger python-selenium automation script with gitlab CI/CD pipeline for my project. I have written a simple login automation script to test whet

Unable to connect to remote PostgreSQL server in Azure Databricks

Error when trying to connect using psycopg2 I'm able to connect to the database from my local machine using the same Python code (works instantly). Error when

Python: How to Handle the Exception to Class variable

I have no idea to implement to handle the class variable exception. I am trying to create python module which has dependency with mongodb. class HrmLookUps(DBMi

How to create a List containing a sub dictionary keys , from nested dictionary?

Form nested dictionary, How to Create a List, containing Sub dictionary keys? dict_lbl = { "lbl1":{"name":"label1","item1":"Accounts", "item2":"kannag

Correctly handling ANSI escaped strings in Python 3

I use ANSI escaped strings in python 3/Ubuntu for printing e.g. colored text to the terminal. When I now try to find the "correct" length of such a string, this

TypeError when querying dataframe with field condition

I am trying to make the following query: df7[df7['bath'] > 10] But I am getting the following error: TypeError: '>' not supported between instances of 'me

Is there a way to embed python turtle script in flask?

I am making a website with flask framework as a simple project, and I'm wondering if there is a way to embed a python turtle script, I know I can use the jinja

while data == 1 run action one time

From an api, I receive a data. It returns two values: 1 and -1. I receive one data per second and in series of 1 or -1. What I want is that when data goes to 1

Jenkins - Continuous deployment for (non-stop running) single-file python application

I have made a simple telegram bot in Python. All code is in one .py file. Trying to achieve "continues deployment" I installed Jenkins, and with the GitHub plug

How can I convert a PureWindowsPath to a Iterable?

I'm working on an academy project to encrypt some files I have managed to encrypt all files from one folder but when there is a folder into that folder i get er