What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-02 17:17:19
how to clear python console in pycharm
This question is a bit old but I thought I would leave this here for other people who are wondering how to do this How to Download this package https://github.com/asweigart/pyautogui. It allows python to send key strokes. You may have to install some o... Add solution -
Python 2022-02-02 02:45:51
record audio with processing python
from sys import byteorder from array import array from struct import pack import pyaudio import wave THRESHOLD = 500 CHUNK_SIZE = 1024 FORMAT = pyaudio.paInt16 RATE = 44100 def is_silent(snd_data): "Returns 'True' if below the 'silent' thresho... Add solution -
Python 2022-02-01 10:16:34
python record audio from microphone
import pyaudio import wave CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 2 RATE = 44100 RECORD_SECONDS = 5 WAVE_OUTPUT_FILENAME = "output.wav" p = pyaudio.PyAudio() stream = p.open(format=FORMAT, channels=CHANNELS, ... Add solution -
Python 2022-02-01 02:21:45
how to make a pygame window
import pygame pygame.init() back = (192,192,192) gameDisplay = pygame.display.set_mode((800,600)) pygame.display.set_caption('A bit Racey') gameDisplay.fill(back) clock = pygame.time.Clock() running = True while running: for event in pygame.event.get(... Add solution -
Python 2022-01-31 10:06:35
how to make window pygame
import pygame pygame.init() back = (192,192,192) gameDisplay = pygame.display.set_mode((800,600)) pygame.display.set_caption('A bit Racey') gameDisplay.fill(back) clock = pygame.time.Clock() running = True while running: for event in pygame.event.get(... Add solution -
Python 2022-01-29 12:30:57
display text in pygame
import pygame pygame.init() window = pygame.display.set_mode((500, 500)) def set_text(string, coordx, coordy, fontSize): #Function to set text font = pygame.font.Font('freesansbold.ttf', fontSize) #(0, 0, 0) is black, to make black text te... Add solution -
Python 2022-01-28 22:55:46
hierarchical clustering dendrogram python example
from scipy.cluster.hierarchy import dendrogram, linkage from matplotlib import pyplot as plt linked = linkage(X, 'single') labelList = range(1, 11) plt.figure(figsize=(10, 7)) dendrogram(linked, orientation='top', labels=labelLi... Add solution