What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-09 11:27:09
pyqt create a qmenu on a button click
import sys from PyQt4 import QtGui, QtCore class MainForm(QtGui.QMainWindow): def __init__(self, parent=None): super(MainForm, self).__init__(parent) # create button self.button = QtGui.QPushButton("test button",self... Add solution -
Python 2021-11-05 11:34:08
simple flask app
# Extremely simple flask application, will display 'Hello World!' on the screen when you run it # Access it by running it, then going to whatever port its running on (It'll say which port it's running on). from flask import Flask app = Flask(__name__) @a... Add solution -
Python 2021-11-02 19:46:23
how to monitor a website traffic python
from flask import Flask, render_template, request, session, jsonify import urllib.request from pusher import Pusher from datetime import datetime import httpagentparser import json import os import hashlib from dbsetup ... Add solution -
Python 2021-10-29 03:02:13
draw line from 2 mouse event in image python
import cv2 class DrawLineWidget(object): def __init__(self): self.original_image = cv2.imread('1.jpg') self.clone = self.original_image.copy() cv2.namedWindow('image') cv2.setMouseCallback('image', self.extract_coordi... Add solution -
Python 2021-10-28 08:33:24
snowflake python connector error handling
import os import snowflake.connector from snowflake.connector.errors import DatabaseError, ProgrammingError snowflake_account = os.environ['SNOWFLAKE_ACCOUNT'] if __name__ == '__main__': try: con = snowflake.connector.connect( us... Add solution -
Python 2021-10-28 02:14:12
how to run same function on multiple threads in pyhton
import multiprocessing def worker(num): """ Worker procedure """ print('Worker:', str(num)) # Mind the "if" instruction! if __name__ == '__main__': jobs = [] # list of jobs jobs_num = 5 # numbe... Add solution -
Python 2021-10-27 14:29:06
pygame doesnt dedect collision between sprite and image
import sys import pygame as pg from pygame.math import Vector2 class Background_Line(pg.sprite.Sprite): def __init__(self, width, height, posX, posY, side): super().__init__() self.image = pg.Surface([width, height]) self.im... Add solution
Best helpers
Ranking is empty