Category "python-3.x"

How can I store a userid and password in SQLite database from my python application?

I'm not a pro in python, I just have a username and password stored statically in my python config file, the app use this credentials to FTP some files. I canno

Why is the error "Cannot use HTMLSession within an existing event loop. Use AsyncHTMLSession instead"?

I'm running the code provided by @Dan-Dev in his answer. from requests_html import HTMLSession url = 'https://www.thefreedictionary.com/love' session = HTMLSes

python websocket pub-sub with re-publish/broadcast

I would like to set-up a server that can subscribe to an external stream over a websocket (ws_ext) and then republish that data (after curating) to internal cli

Python: appending numpy.array to list python overwrites the previous elements

I'm trying to plot a stellar orbit in a given potential. First, I initialize the position and velocity, and derive the acceleration from the position according

Unable to delete PowerPoint Slides using Python-pptx

I am trying to delete PowerPoint slides containing a specific keywords using Python-pptx. If the keyword is present anywhere in the slide then that slide will b

how to use re.sub to replace matches with a series of numbers

I'm trying to remove all HTML tags from a text file and after some processing on the text , I have to put the HTML tags back in the text, So i thought maybe rep

Printing values in new columns based on a condition from another column

I have a following dataframe: Time Tab User Description 27.10.2021 15:58:00 Tab Alpha [email protected] Tab Alpha of type PARTSTUDIO opened by User A 27.10.2021

how do I make a chloropleth map zip code to column in folium

I am trying to create a chloropleth by mapping zip codes to a cluster column on a data frame playing with stuff I've found on the folium site and tutorials, but

Writing BytesIO objects to in-memory Zipfile

I have a Flask-based webapp that I'm trying to do everything in-memory without touching the disk at all. I have created an in-memory Word doc (using python-docx

importing pyttsx3 in python3.8 and found an error

I downloaded pyttsx3 in command prompt I have a big error this the code: import pyttsx3 engine = pyttsx3.init() engine.say("I will speak this text") engine.runA

How to stop this running threading.Thread?

I found this non blocking code on stack overflow which is using threads to provide functionality of nonblocking setInterval function in JavaScript. But when I t

How to fix " TypeError: post_details() got an unexpected keyword argument 'slug' "

I'm creating my blog with django, and trying to make posts urls in slug way, after I created the models and called it in views it showed me this error: [TypeErr

Unable to return json values retrieved from MongoDB to HTML page in python flask

I'm able to retrieve required value from MongoDB individually and also able to print same values but unable to return all those values to HTML page. When I try

How to split a string in to list where the number of string in the list is defined?

So if I have a string: s = "this is just a sample string" I want to obtain a list of 3 characters each: l = ["thi", "s i", "s j", "ust", " a ", ...]

Error: Bad Gateway 502 when opening Google App Engine Python Domain

When I'm visiting my website (https://osm-messaging-platform.appspot.com), I get this error on the main webpage: 502 Bad Gateway. nginx/1.14.0 (Ubuntu). It'

Pip cannot find metadata file - EnvironmentError

Whenever I run pip to install the Flask packages like virtualenv in Ubuntu 16.04, I get this error: pip install virtualenv Requirement already satisfied: virt

Python Tweepy app will not run on new machine but runs on my laptop

Just like it says. The app runs like a charm on my MacBook but on my M1 MacMini, both machines run Python3.7.2, server I get this error. Traceback (most recent

Invocation timed out using Sagemaker to invoke endpoints with pretrained custom PyTorch model [Inference]

I have a pretrained model based on PyTorch (contextualized_topic_models) and have deployed it using AWS sagemaker script model. However, when I tried to invoke

How to call class method in robot framework?

I am getting error "No keyword with name 'addition' found." py file class A: def addition(self,a,b): print(a+b) obj=A() obj.addition(4,5) robot code

Python-3 Minecraft UUID to Username using the Requests library

I am wondering if it is possible to take a minecraft UUID and convert it into the users current username. I know how to get all of there previous usernames, but