Category "python-3.x"

Sending Notifications to certain clients using Server Sent Events in FastApi?

I have been working with server sent events to send out certain type of notifications to only certain clients. I am using the module called sse-starlette to try

Unable to import mlflow, getting ModuleNotFoundError: No module named 'mlflow'

Unable to import mlflow in a .py script. ModuleNotFoundError: No module named 'mlflow' The script runs in a python:3.7-stretch Docker container Use requirement

Should I only be using one or multiple instances of python's secrets.SystemRandom() class?

I am trying to generate random numbers securely and I found the secrets module, apparently the only way to generate random numbers is to have an instance of the

pyspark self class variable using to read csv file for dataframe

I have to call csv file to read data frame as below format, i can read normal file read but using self variable , i am not aware of it. kindly help us. from pys

Tkinter FileMenu....not working (no error code)

I am using the following code but cant seem to get a help-menu in the actual window. Can you see anything in terms of menu when you run the code ? I have tried

How to write binary data to stdout in python 3?

In python 2.x I could do this: import sys, array a = array.array('B', range(100)) a.tofile(sys.stdout) Now however, I get a TypeError: can't write bytes to te

why does python3.6 container uses the /usr/lib of python 3.9

I start a docker contain with FROM python:3.6 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install -y apt-utils vim curl apache2 apache2-ut

Create a mock TextIOWrapper for using as a middleman for subprocess

I am running an automation on a script and I want to evaluate the output of the shell instance before it gets written to a file. bashCommand = "ls -a" middleman

Using float numbers in 'range' and 'subsetting'

I am working on a small assignment in which I am required to use 'array' and very basic and simple stuff to create a function that draws math functions such as:

ROS Services in python. Server and client node

Hi I create not ROS python code for the server and the client. But need some help in implementing the ROS part for both of them. The Server only need to print a

Vertex AI scheduled notebooks doesn't recognize existence of folders

I have a managed jupyter notebook in Vertex AI that I want to schedule. The notebook works just fine as long as I start it manually, but as soon as it is schedu

Reportlab add space between Balanced columns

For the balanced column in reportlab, I want to increase the spacing between the columns so that no text gets very close to each other and there is a clear sepa

xlwings book open excel workbook but change the file name to lowercase

I used xlwings to open excel workbook. It worked fine up to last month. But today, when I run the same code, it opened my worksheet but convert my worksheet nam

Skip clicking on an element in the While loop, when opening a popup with selenium. Problem with While loop

This loop scrolls through the list of names on a web page and clicks on each "Add" button next to the name. It works well and correctly wait = WebDriverWait(dri

How do I combine a datetime and time fields?

I have two fields that I need to parse and combine together to form a full datetime field. The first field is a date field but in the form of a datetime field a

How to make my Pygame window always active and listening for input?

I spent the last 3 hours searching for a way to create a simple toggle button script that lets me know if a button on my Thrustmaster HOTAS has been pressed. As

virtualenv not activated on windows 11

Im using python 10 and windows-11 i try to activate venv with the following command .\onlineShop\Scripts\activate.bat I create venv using following command pyt

Python: Print string in reverse

Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done"

subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1 [duplicate]

I was trying to install the dlib package for my face recognition project but error keep getting in the way. This is another error and I don't

Getting the next element of a list on a function call

Is there a way to return the next element in a list on a function call, this is what I have tried so far: from itertools import cycle def get_next_element():