I have been provided with a pem certificate to authenticate with a third party. Authenticating using certificates is a new concept for me. Inside are two certificates and a private key. The issuer has advised they do not support SSL verification but use TLS(1.1/1.2). I have run a script as below: I’m ge…
How do I pause other processes when user input / confirmation is required Subprocess Python
If I have a script (process run.py) that will run 3 subprocesses A.py, B.py, C.py (3 scripts called at same time through process run.py). The operation is fine. However say in b.py i have a line such as (pref) How can i get subprocess of A.py and c.py to wait/pause for 5seconds, in order for user to enter y o…
Remove a substring from a list of string using Pandas
I’m trying to search some post related to remove substring key but unfortunately those solutions don’t work in my case. Could you help me ? Input: Output Answer You don’t even need pandas for that. A simple list comprehension should be enough
how to return None for empty array in python?
I have a dataframe with two columns. Column one contains an integer, the second column a list with multiple items, which also can be empty. I want to return a list with tuples, in which the first part of the tuple is the integer from col1, and the second part of the tuple is the integer from col2, listing in
Using an if statement for terminating (return) the function for null conditionals, when is it best to introduce a variable? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago. Improve this question I have an excel file with multiple tags in the format of key-value pai…
Plotting row based data
I have some data that looks something like this: What I would like to do is to plot the values of the header dates, but grouped by id and period. So essentially this would become 6 line plots, with the x-axis given as the dates. However, maybe I’m just tired, but this data set is weirdly put together im…
python generate QR code png without file output
I am using pypng and pyqrcode for QR code image generation in django app. When I call getQrWithURL with a url, it produces a file url.png to my directory. Is there a way to only get the image data without producing a file output? thanks for your help. Answer Use a BytesIO as a writable stream: Your variable P…
Discord.py ctx commands not recognised
im fairly new to coding in general and recently started trying to code my own bot. Almost all of the tutorials i have seen use the ctx command however, whenever i use it i get this error: Here is part of my code that uses the ctx command. The aim is to get it to delete the last 3 messages
What is the best way to document websocket messages in Aiohttp/Python?
I use aiohttp-swagger to create useful documentation of my http endpoints, but I also have websocket which can send/receive several types of messages (all json for the project), what is the best way to document these messages? Answer AsyncAPI is the analog of the OpenAPI Specification (fka Swagger Specificati…
how to delete contact by number telethon
Imports: Code: That code first add an phone_number to our contacts list and after we can easily get their username. After we delete that contact as we just needed their username. But some users don’t have set username so we get username as None. Now how to remove that contact ? Currently I use client(fu…