I created a script which just asks a user for their name and age using Python’s input() function. I installed the package Script. This ran the script well but couldn’t deal with the input. I have also tried a number of other options but haven’t had any success. Any ideas how to build and execute scripts…
Mac can’t find chromedriver when running python script from launchctl
I’ve been trying to schedule one of my python scripts through launchctl and am coming up against an error. The intention is that this runs at a given time past the hour, every hour. I’ve created my plist, loaded it in launchctl but it’s not working properly. After doing some digging I debugg…
IntegrityError NOT NULL constraint failed: – in validating form missing user id (foreing key of anothermodel)
Previous title: Unable to import ‘misaka’ – Django I am following a tutorial about how to build a social network. I run into this error: IntegrityError at /posts/new/ NOT NULL constraint failed: posts_post.user_id Complete traceback (please note the lines in bold): The lines in bold are poin…
get a list from html source using python3
I am trying to get Cases list of COVID-19 positive cases from https://www.worldometers.info/, e.g. this The sample looks like(~line no: 700) : I am using bs4 as: which does scrape the file, but after that I am clueless how to get the data. The list I am looking for is commented with ## I NEED THIS LIST. Kindl…
Why BINARY usage in SQLAlchemy with Python3 cause a TypeError: ‘string argument without an encoding’
I read a lot of similar questions but none of the clearly answer my issue. I’m using sqlalchemy-utils EncryptedType on a mysql table column. The table creation and the insert is ok, but when I’m trying to do a query a receive: I found out that this error occurs only using python 3, not using pytho…
Regex to extract usernames/names from a string
I have strings that includes names and sometime a username in a string followed by a datetime stamp: I want to extract the usernames from this string: I have tried different regex patterns the closest I came to extract was following: Using the following regex pattern: Answer You may get all text up to the fir…
MySQLInterfaceError: Python type list cannot be converted
it returns : MySQLInterfaceError: Python type list cannot be converted Answer One solution is to convert list to string like this.
how can i show the front cover image of an audio file
I am working on a music player program, i wanted to show the song default image while playing it, so how can I add and show it in a Tkinter window. this what i have tried: Output: this helped me to get all the information about its cover image but i wanted to show it in my Tkinter window. Answer
How to debug django staticfiles served with whitenoise, gunicorn, and heroku?
I’ve got a project that runs on Heroku from a Dockerfile and heroku.yml. The site generally works, but I am having trouble with static files. collectstatic is run when building the pack. If I set DEBUG to True, it finds the files. I’m trying to use whitenoise but not sure why it’s not workin…
FFMPEG concat leaves audio gapes between clips
I’m writing a python script that uses subprocess to invoke FFMPEG, not using pyffmpeg. My script generates a variable number of MP4 files using the AAC audio codec, and concatenates them together using FFMPEG. Here is how I’m constructing each clip: The command I’m using to concatenate them …