Skip to content

Instantly share code, notes, and snippets.

import pygame
def init():
pygame.init()
win = pygame.display.set_mode((400,400))
def getKey(keyName):
ans = False
for eve in pygame.event.get(): pass
keyInput = pygame.key.get_pressed()
# echo-server.py
import socket
HOST = "127.0.0.1" # Standard loopback interface address (localhost)
PORT = 65432 # Port to listen on (non-privileged ports are > 1023)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((HOST, PORT))
s.listen()
import numpy as np
import cv2
from cv2 import aruco
from time import sleep
from djitellopy import tello
me = tello.Tello()
me.connect()
import numpy as np
import cv2
from cv2 import aruco
import time
from djitellopy import tello
import keyPressModule as kp
# cap = cv2.VideoCapture(0)
import numpy as np
import cv2
from cv2 import aruco
cap = cv2.VideoCapture(0)
print("Take off complete")
# w, h = 640, 480
w, h = 1280, 640
import time
import argparse
import numpy as np
import cv2
from cv2 import aruco
from djitellopy import tello
from pydub import AudioSegment
def mp3_to_wav(audio_file_name):
if audio_file_name.split('.')[1] == 'mp3':
sound = AudioSegment.from_mp3(audio_file_name)
audio_file_name = audio_file_name.split('.')[0] + '.wav'
sound.export(audio_file_name, format="wav")
import os
# comment out below line to enable tensorflow logging outputs
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import time
import tensorflow as tf
physical_devices = tf.config.experimental.list_physical_devices('GPU')
if len(physical_devices) > 0:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
from absl import app, flags, logging
from absl.flags import FLAGS
@Paulooh007
Paulooh007 / SPSummaryFromUrl.java
Created May 2, 2022 09:43
Technical Test from TeamApt- OAU Undergraduate Internship
package com.starter;
import java.io.*;
import java.net.URL;
import java.util.Arrays;
public class SPSummaryFromUrl {
public static void main(String[] args) throws IOException {
from djitellopy import tello
import keyPressModule as kp
from time import sleep
kp.init()
me = tello.Tello()
me.connect()
print(me.get_battery())
def getKeyboardIinput():