Python – how to construct SQL with “AND” and “OR” with LIKE

def run_query_table_multi( search, and_flag=False ): if and_flag is True: combo = ” and ” else: combo = ” or ” try: conn = mariadb.connect( user=self.user, password=self.password, host=self.host, port=self.port, database=self.database ) except mariadb.Error as e: print(f”Error connecting to MariaDB Platform: {e}”, e) sys.exit(1) # Get Cursor cur = conn.cursor() my_sql_qry = “SELECT rec_id, title, http from recipe where” q_bld = “” […]

Python3 – strip html tags from string

Here is a code snippet to strip tags and leading and trailing whitespace   def remove_html_tags text): “””Remove html tags from a string””” clean = re.compile(‘<.*?>’) ntxt = re.sub(clean, ”, text ) return ntxt.strip()  

Updating Jessie Debian in 2022

I had this old Virtual machine running Jessie.  Turnkey Linux/Debian root@TurnkeyLamp apt/sources.list.d$ uname -a Linux TurnkeyLamp 3.16.0-6-amd64 #1 SMP Debian 3.16.56-1+deb8u1 (2018-05-08) x86_64 GNU/Linux In order to update add check-valid-until=no to the archive Debian repository deb http://archive.turnkeylinux.org/debian jessie main deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main deb http://httpredir.debian.org/debian jessie main deb http://httpredir.debian.org/debian jessie contrib # deb http://httpredir.debian.org/debian jessie non-free Stack exchange link