What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-03 06:44:15
how to create a window in 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 2021-11-02 00:11:10
move mouse round in python
import pyautogui import math # Radius R = 400 # measuring screen size (x,y) = pyautogui.size() # locating center of the screen (X,Y) = pyautogui.position(x/2,y/2) # offsetting by radius pyautogui.moveTo(X+R,Y) for i in range(360): # setting pace ... Add solution -
Python 2021-11-01 18:54:15
pygame rect follower
import pygame import random import math # --- constants --- (UPPER_CASE_NAMES) SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 FPS = 25 # for more than 220 it has no time to update screen BLACK = (0, 0, 0) WHITE = (255, 255, 255) # --- classes --- (CamelCaseN... Add solution -
Python 2021-10-29 16:11:19
how to setup pygame
# To install pygame, type 'pip install pygame' in the # windows powershell or the os terminal # To create a blank screen as a setup for a game, use: import pygame import sys pygame.init() clock = pygame.time.Clock() FPS = 30 # How many times the scre... Add solution -
Python 2021-10-29 09:15:16
load images pygame
import pygame from pygame.locals import* img = pygame.image.load('clouds.bmp') white = (255, 64, 64) w = 640 h = 480 screen = pygame.display.set_mode((w, h)) screen.fill((white)) running = 1 while running: screen.fill((white)) screen.blit(img,(0... Add solution -
Python 2021-10-28 23:11:08
how to make a virtual assistant with python
import speech_recognition as mic import pyttsx3 import pywhatkit import datetime import wikipedia import pyjokes listener = mic.Recognizer() engine = pyttsx3.init() voices = engine.getProperty('voices') engine.setProperty('voice', voices[1].id) def tal... Add solution