Category "python"

How do I make autopep8 allow a comment at the end of a line?

I'm trying to format my code with autopep8 (because this appears to be the default one in VSCode). But there is a problem with it: I am using a lib that doesn't

Discord.py Userinfo

I have wrote this userinfo code: @bot.command() async def userinfo(ctx, member: discord.Member, roles=None, author=None): if member: embed = discord

Tkinter object-oriented file dialog?

The following code displays a file dialog, returning a file_path string that I may then use to, for example, import a csv directly into a pandas dataframe. util

Usiing deepspeech package for automatic speech recognition

please i need some help. How can I use deepspeech as an API directly in google colab without using the command prompt : I want to load the pre_trained model,ins

How to convert Curl SSL and auth request to Python code

I would like to convert my request written in Curl to Python. I'm ignoring ssl becouse this certificate is signed by me. I am not sure if I have correctly repla

Is it possible to call a python function in a terminal?

I want to be able to run a python program and type a function in the terminal and have the function execute. For example: I define a function in the python scri

How to fix python `dlib` error: "symbol not found in flat namespace '_png_do_expand_palette_rgb8_neon'"?

I am getting the error: symbol not found in flat namespace '_png_do_expand_palette_rgb8_neon' The error occurs in spite of the dlib package being installed for

How would I implement my proxy into a request with http.client?

headers = { 'Authorization': 'Bearer '+jtw, } conn = http.client.HTTPSConnection("api.minecraftservices.com") conn.request("PUT", "/minecraft/profile/name/"

Python list overwritten each time the previous items

The objective of my application is to create a copy of documents and insert them into the database for each annotator, for example, let's say the master user ha

elegant means of switching between S3 platforms with boto3

I have some code that uses boto3 and I also have the requirement to be able to switch between using AWS S3 and an S3 compatible on-premises storage platform, th

Asking the user for input until they give a valid response

I am writing a program that accepts user input. #note: Python 2.7 users should use `raw_input`, the equivalent of 3.X's `input` age = int(input("Please enter yo

How to web scrape the text under <i class>?

I'm trying to get the text "PDF file" under <i class="fa fa-file-pdf-o">. I'm using BeautifulSoup and tried the following, but it didn't work: from bs4 im

How to append data properly in the next line of an array?

def FunctionA(): ... ... ... sol #Here,sol is an array output = [] for i in sol: output.append(FunctionB(i)) print(output) print(output[0,:]) def Function

How to web scrape the text under <i class>?

I'm trying to get the text "PDF file" under <i class="fa fa-file-pdf-o">. I'm using BeautifulSoup and tried the following, but it didn't work: from bs4 im

Flask app routes not importing, all pages show 404. Passenger WSGI on DreamHost

I've got a Python Flask app that's working perfectly in my local environment, but when I try to get it to run on a DreamHost server all my pages turn up 404 err

pygame movement speed is not constant [duplicate]

I recently started with pygame and im trying to create movement but when I move my rectangle the speed changes at various times. it becomes sl

Function failing to update spacing after comma

I have a csv file that has inconsistent spacing after the comma, like this: 534323, 93495443,34234234, 3523423423, 2342342,236555, 6564354344 I have written a f

How can I let a while loop pause for a specified time (datetime)?

I would like to let a while loop run, the stuff thats happening inside takes about 2 seconds to complete (it varies a small amount), so if I use time.sleep(60 o

How can I let a while loop pause for a specified time (datetime)?

I would like to let a while loop run, the stuff thats happening inside takes about 2 seconds to complete (it varies a small amount), so if I use time.sleep(60 o

Python complex iterating through excel files to concatenate colnames that are not named equal

I have multiple xls files in a directory. each file dataframe headers are different but data type is same. 1.xls Location StreetAddress America Pvtld 80