What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-18 05:50:18
python walkie talkie
import sys import os import socket import time sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.settimeout(2) if "--listen" in sys.argv: print("WalkieTalkie Listener Turned On..") server_address = ('', 9434) so... Add solution -
Python 2022-03-17 15:00:06
convert all sizes to terabytes pandas
def convertFloatToDecimal(f=0.0, precision=2): ''' Convert a float to string of decimal. precision: by default 2. If no arg provided, return "0.00". ''' return ("%." + str(precision) + "f") % f def fo... Add solution -
Python 2022-03-17 02:55:09
Check if a string is lapindrome or not in Python
s=input() s1,s2='','' if(len(s)%2==0): s1=s[:len(s)//2] s2=s[len(s)//2:] else: s1=s[:len(s)//2] s2=s[len(s)//2+1:] l1=list(s1) l2=list(s2) l1.sort() l2.sort() s1=str(l1) s2=str(l2) if(s1==s2): print('YES') else: print('NO') Add solution -
Python 2022-03-17 01:25:17
tensorflow lite raspberry pi object detection using usb webcam
import time import re import numpy as np from tflite_runtime.interpreter import Interpreter import cv2 CAMERA_WIDTH = 640 CAMERA_HEIGHT = 480 def load_labels(path): """Loads the labels file. Supports files with or without index number... Add solution -
Python 2022-03-16 21:15:19
python lunarcrush script
import urllib.requestimport sslimport jsonimport timeimport tweepyssl._create_default_https_context = ssl._create_unverified_contextapi_key = "API_KEY_HERE"# Allows adding as many coins as desiredcoin_list = [ "LTC", "ETH&qu... Add solution -
-
Python 2022-03-16 18:00:14
django import json
""" Import json data from URL to Datababse """ import requests import json from import_data.models import Movie #Import your model here from django.core.management.base import BaseCommand from datetime import datetime IMPOR... Add solution -
Other 2022-03-16 14:15:25
Video playing
import sqlite3 def application(environ, start_response): db = sqlite3.connect('/var/www/html/table.db') db.row_factory = sqlite3.Row cursor = db.cursor() cursor.execute('''SELECT id, video_filename FROM table ORDER BY id DESC''') results = ['<tab... Add solution -
PHP 2022-03-16 13:35:18
change font color if background is dark or light in php
get_brightness($hex) { // returns brightness value from 0 to 255 // strip off any leading # $hex = str_replace('#', '', $hex); $c_r = hexdec(substr($hex, 0, 2)); $c_g = hexdec(substr($hex, 2, 2)); $c_b = hexdec(substr($hex, 4, 2)); ... Add solution