Skip to content

Instantly share code, notes, and snippets.

@rupython
rupython / redactor.py
Created March 23, 2021 19:29
From: MichaiL
class Date:
def __init__(self, d1, d2):
self.d1 = d1
self.d2 = d2
self.c = {1: 31, 2: 28, 3: 31, 4: 30, 5: 31, 6: 30,
7: 31, 8: 30, 9: 31, 10: 30, 11: 31, 12: 30}
def __sub__(self, other):
if (self.d1, self.d2) == (other.d1, other.d2):
@rupython
rupython / my_calculator.py
Created March 15, 2021 10:44
From: Алексей
d = 'стоп'
e = 'Для завершения работы напишите "стоп" в любом поле.'
f = 'На ноль делить нельзя. Попробуйте снова!'
j = 'Введены неверные значения. Попробуйте снова!'
while True:
a = input('Введите 1-ое число: ')
if a == d:
break
b = input('Укажите команду (+, -, *, /, **, //, %): ')
@rupython
rupython / Kennedy.txt
Created March 10, 2021 18:32
From: pishite
We observe today not a victory
of party but a celebration
of freedom symbolizing an end
as well as a beginning
signifying renewal as well
as change
@rupython
rupython / OUTPUT.txt
Created March 8, 2021 11:00
From: Stanislav
a,b = int(input()),int(input())
print(a + b)
@rupython
rupython / tmp.py
Created March 7, 2021 17:00
From: Andrey
def defKey(i):
return i[1]
def dist(a, b):
r = []
i, j, start = 0, 0, 0
end = b[j][1]
while i != len(a):
if a[i][1] not in range(start, (end + 1)):
start = b[j][1]
@rupython
rupython / main (3).py
Created March 7, 2021 14:01
From: Alik Like
from flask import Flask, request, jsonify
import requests
import json
import flask_cors
app = Flask(__name__)
flask_cors.CORS(app, resources={r"/*": {"origins": "*"}})
bot_url = "https://api.telegram.org/botтутмойтокен/"
admin_log_chat_id = "-тутchatid"
import tkinter as tk
import random
from tkinter import simpledialog
def manual():
dg=tk.Toplevel(hw)
dg.title('Manual')
dg.resizable(0,0)
dgC=tk.Canvas(dg, width=900, height=600)
dgC.pack()
@rupython
rupython / main.py
Created March 5, 2021 20:38
From: Matvei30415
from sys import exit
def remove_number(lst):
if k in lst:
z = lst.index(k)
for i in range(len(lst) - z - 1):
lst[z], lst[z + 1] = lst[z + 1], lst[z]
@rupython
rupython / main.py
Created March 5, 2021 20:30
From: Matvei30415
def remove_number(lst):
if k in lst:
z = lst.index(k)
for i in range(len(lst) - z - 1):
lst[z], lst[z+1] = lst[z+1], lst[z]
z += 1
lst[-1] = 0
@rupython
rupython / source.py
Created March 3, 2021 09:42
From: Djimbo
# - *- coding: utf- 8 - *-
import logging
import sqlite3
import time
from data.config import bot_description
def logger(statement):
logging.basicConfig(