This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
import logging | |
import time | |
__version__ = "0.2.0" | |
initial_sql = """CREATE TABLE IF NOT EXISTS log( | |
TimeStamp TEXT, | |
Source TEXT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from win32com import client | |
def process_sql_in_mdb(mdb_file_path: str, sql: str): | |
''' | |
:param mdb_file_path: Full path to .mdb file | |
:param sql: sql query | |
:return: row set for db | |
''' | |
connection = client.Dispatch(r'ADODB.Connection') | |
row_set = client.Dispatch(r'ADODB.Recordset') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from PIL import Image | |
from playsound import playsound | |
oauth_url = 'https://oauth.yandex.com/token' | |
client_id = 'iddddddd' | |
client_secret = 'secret' | |
username = '[email protected]' | |
password = 'passowrd' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -loop 1 -i image.jpg -i audio.wav -c:v libx264 -tune stillimage -c:a aac -strict experimental -b:a 192k -pix_fmt yuv420p -shortest out.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from github import Github | |
account = Github('username', 'password') | |
repo = account.get_repo('username/your_public_repository') | |
repo.create_file("new_file.txt", "init commit", "file_content ------ ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from github import Github | |
def go_github(): | |
allowed_acc = ['allowed_friend1', 'allowed_friend2', 'username'] | |
account = Github("username", "password") | |
for repo in account.get_user().get_repos(): | |
owner = repo.owner.login | |
if owner not in allowed_acc: | |
print(owner) | |
repo.remove_from_collaborators('username') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import requests | |
from stem import Signal | |
from stem.control import Controller | |
import time | |
class TorSession(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management.base import BaseCommand, CommandError | |
from django.db import connection, connections | |
from django.db.utils import OperationalError | |
| |
| |
class Command(BaseCommand): | |
| |
def add_arguments(self, parser): | |
parser.add_argument('target_base', nargs='+', type=str) | |
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2 | |
import random | |
num_iterations = 1000 | |
db = 'domains' | |
host = '127.0.0.1' | |
pwd = 'topsecretmegapassword' | |
conn = psycopg2.connect(database=db, | |
user=db, | |
password=pwd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def s_p_s_result(my, enemy): | |
if my == enemy: | |
return 'Ничья' | |
elif (my, enemy) in [('Ножницы', 'Бумага'), ('Камень', 'Ножницы'), ('Бумага', 'Камень')]: | |
return 'Ты победил' | |
else: | |
return 'Я выиграл' |
NewerOlder