Category "python-3.x"

F5 SDK - SSL Insecure request

Is there a way to ignore SSL? I'm running Python 3.10.1 code: from f5sdk.bigip import ManagementClient device = ManagementClient('10.10.17.127', user='admin',

How to use a variable/function from a class instance in a differrent class with kivy?

first, I'm new here, so don't hesitate to correct me if I act innapropriatly ! I'm making a sudo turn based RPG combat to train with kivy tools and I've come in

Django customUser models

I have faced two or three issues with django customuser model. The first one being the skills models. I wanted to add the Skills in the custom user, realized th

Python: round(random.uniform) printing wrong float value on output console but in background its correct value

See the following code import re import random s = "~|21|050000|voltage|current|ApparentPower|12345~" for _ in range(100): vol_val = round(random.uniform(23

Python argparse unexpected behavior when passing "``" to the argument string in pysaprk cluster mode

I am trying to pass a string in my pyspark code and it works fine but when i pass the following string to escape reserved keyword `date` or any value passed in

communicating with serial virtual COM port using python

I have written snippet below to communicate (send a simple '1' character) with serial virtual COM3 port, which is connected to a STM32 board, using python. But

from django.core.management import execute_from_command_line not working

I am working on a bug project. Which is on Python 2.7, we are migrating to Python 3.9. I am getting import errors in manage.py during importfrom django.core.man

Insert a png image in a matplotlib figure

I'm trying to insert a png image in matplotlib figure (ref) import matplotlib.pyplot as plt import numpy as np from matplotlib.figure import Figure from matplo

How to write .xlsx data to a .txt file ensuring each column has its own text file, then each row is a new line?

I believe I am close to cracking this however I can't add multiple lines of text to the .txt files. The column do relate to their own .txt files. import openpyx

What is the difference between these two codes? (Python: circular singly linked list)

These are the codes for __iter__ method of a circular singly linked list. But I don't understand the difference between the two. def __iter__(self): node =

What is the difference between these two codes? (Python: circular singly linked list)

These are the codes for __iter__ method of a circular singly linked list. But I don't understand the difference between the two. def __iter__(self): node =

apply a function on each elements of a list

I want to apply a function to each element of a list. I want to avoid for loop here. I have list of path names as output from tar.getnames(). I want to get list

Python and vs or in while loop

choice = input('Enjoying the course? (y/n)') while choice != "y" or choice != "n": choice = input("Sorry, I didn't catch that. Enter again: ") im trying to

bool() vs is not None [duplicate]

I have two functions that return a bool. The first is using bool() and the second is using is not None. def func_1(x) -> bool: return b

Syntax error when trying to insert record into posgtresql using pg8000 driver

When I am trying to insert a record into Postgresql I am getting below error. pg8000.exceptions.DatabaseError: {'S': 'ERROR', 'V': 'ERROR', 'C': '42601', 'M':

Problem with exception handling using Python requests module

The following part of my code is supposed to do exception handling during HTTP requests. app.py class Get: def __init__(self, url): self.url = url

Boto 3 filter_log_events returns null but describe_log_streams gives correct values

I am trying to retrieve cloud watch logs from log group /frontend/lambda/FEservice. The logs are stored in multiple stream with pattern YYYY/MM/DD/[$LATEST]* Ex

Can you explain me the RLE algorithm code in python

I I've finally found how to make a RLE algorithm by watching a tutorial but This tutorial didn' t explain something in that code I didn't get why we write j = i

Setting log file for a cron job with the log file name as date

I am trying to set log file for a cron job and the name of the log file should be date. The cron job is set like this. 55 09 * * * /home/program/my_folder/main.

How to prevent python from automatically escaping backslash with dubble backslash

I'm looking for a method to forward a string so for example ip 1.1.1.1 becomes ^1\.1\.1\.1$. I tried a couple of thing but all of them results in the following