Skip to content

Instantly share code, notes, and snippets.

@RimMirK
RimMirK / TextDB.py
Last active November 13, 2023 11:56
class TextFileDB:
"""
Text File DataBase v1 :)
----------
only supports simple data types (int, float, bool, NoneType), but does not require libraries
+ init ( path = "db.txt" )
+ get ( key: str = None, default: any = None) -> dict[str, any]
+ update ( dict [str, any] ) -> any
"""
@RimMirK
RimMirK / nsad
Created April 11, 2023 07:29
2134
from random import*
a = int(input("введи целое число: "))
x = False
while True:
if a % 2 != 0:
a = a*3+1
print(a)
continue
if a % 2 != 0:
@RimMirK
RimMirK / 1.py
Created April 11, 2023 07:24
123
from random import*
a = int(input("введи целое число: "))
x = False
while True:
if a % 2 != 0:
a = a*3+1
print(a)
continue
if a % 2 != 0:
@RimMirK
RimMirK / test.py
Last active April 11, 2023 06:31
GIST created by python code
import pyautogui
import time
ts = time.sleep
num = 426
ts(3)
@RimMirK
RimMirK / python request module
Created April 11, 2023 06:27
GIST created by python code
Python requests has 3 parameters: 1)Request URL
2)Header Fields
3)Parameter
4)Request body
'''
HTTP Reuests has following parameters:
1)Request URL
2)Header Fields
3)Parameter
4)Request body
'''
#!/usr/bin/env python
import requests
@RimMirK
RimMirK / bot.py
Last active April 11, 2023 06:17
# Импорты
from requests.exceptions import ConnectionError
import telebot, pytz, datetime, times, shutil
from telebot import types
# Определение бота
bot = telebot.TeleBot("TOKEN", parse_mode="MARKDOWN")
bot.set_webhook()
e:\codes>sound.py
pygame 2.1.2 (SDL 2.0.18, Python 3.10.8)
Hello from the pygame community. https://www.pygame.org/contribute.html
Note: Illegal Audio-MPEG-Header 0xffe6013f at offset 37692.
Note: Trying to resync...
Note: Skipped 374 bytes in input.
Traceback (most recent call last):
File "E:\codes\sound.py", line 4, in <module>
pygame.mixer.music.play()
pygame.error: mpg123_seek: Invalid RVA mode. (code 12)