Skip to content

Instantly share code, notes, and snippets.

View tsgiannis's full-sized avatar

John Tsioumpris tsgiannis

View GitHub Profile
@tsgiannis
tsgiannis / tzoker_predictor.py
Last active February 21, 2022 20:49
Simple tzoker predictor
import random
from time import sleep
logo = """
_ _ _ _ _
| |_ _______ | | _____ _ __ _ __ _ __ ___ __| (_) ___| |_ ___ _ __
| __|_ / _ \| |/ / _ \ '__| | '_ \| '__/ _ \/ _` | |/ __| __/ _ \| '__|
| |_ / / (_) | < __/ | | |_) | | | __/ (_| | | (__| || (_) | |
\__/___\___/|_|\_\___|_| | .__/|_| \___|\__,_|_|\___|\__\___/|_|
|_|
@tsgiannis
tsgiannis / split.py
Last active February 18, 2022 22:25
Split a code file into smaller ones ...e.g you have a python file that has multiple classes ..and for easier studying you want to split it.
matches = ["class", "(", ":"]
with open("sailor.py") as f:
lines = f.readlines()
currentclassname = ''
currentlines =[]
for line in lines :
if all(x in line for x in matches) : # we have found a class
classname = line.split(" ", 2)[1].split("(",1)[0]
print(classname)
currentclassname=classname