Skip to content

Instantly share code, notes, and snippets.

Information wants to be free.

Andrei Andreev drew2a

Information wants to be free.
View GitHub Profile
import argparse
import asyncio
import logging
from pathlib import Path
from types import SimpleNamespace
import libtorrent
from pony.orm import db_session
from tribler_core.modules.libtorrent.torrentdef import TorrentDef
def kilo(value):
return f'{value / 1000:.1f}kN'
def fall_force(m, fall_factor, elongation_factor=0.3):
return (9.8 * 2 * m * fall_factor) / elongation_factor
print(kilo(fall_force(80, 2))) # 10.5kN
print(kilo(fall_force(80, 1.7))) # 8.9kN
View Flake8 & Pycharm in Tribler
1. Install `flack8` and `import-order` plugin:
Note: Below all examples imply the use of venv for the project.
python3 -m pip install flake8
python3 -m pip install flake8-import-order
2. Add `File Watcher`: