What do you want to save?
Add Code snippet
New code examples
-
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-05 19:25:11
python insert on a specific line from file
f = open("path_to_file", "r") contents = f.readlines() f.close() contents.insert(index, value) f = open("path_to_file", "w") contents = "".join(contents) f.write(contents) f.close() Add solution -
Other 2022-01-22 08:01:08
alterning format when reading from a text file
with open("videos.txt") as f: lines = [l.strip() for l in f.readlines()] available_videos = "" for line in lines: title, video, tags = [x.strip() for x in line.split("|")] available_videos += f"{title} ({vid... Add solution -
Python 2021-11-15 22:32:18
instagram username checker
import requests import random import time import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) f = open("username_text_file.txt", "r") # create a text file with the usernames you want to check data = f.re... Add solution -
Python 2021-11-04 23:21:06
lines = paths.read().splitlines()
pythonCopy>>> filePath = r"/your/file/path" >>> with open(filePath, 'r', encoding='utf-8') as f: f.readlines() ['Line One: 1\n', 'Line Two: 2\n', 'Line Three: 3\n', 'Line Four: 4\n', 'Line Five: 5'] Add solution
Best helpers
Ranking is empty