Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Lari Liuhamo Diapolo10

🏠
Working from home
Block or report user

Report or block Diapolo10

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Diapolo10
Diapolo10 / four_fours.py
Last active Jan 19, 2020
A general solution for the four fours problem
View four_fours.py
# log(log(sqrt(4), 4), (sqrt(4)/4)) == 1
import math
def repeat(func, n):
x = 4
for _ in range(n):
x = func(x)
return x
@Diapolo10
Diapolo10 / main.py
Last active Aug 30, 2019
Python range-function example definition
View main.py
#!/usr/bin/env python3
from typing import Generator, Optional
from numbers import Real
def my_range(start: Real, stop: Optional[Real]=None, step: Real=1) -> Generator[Real, None, None]:
""" An example definition of Python 3's range-class as a function """
# If only one argument was provided, use that
# argument as the goal and set start to 0
View pip_auto_update.bat
@echo off
rem Define a (local) name for the temporary file
setlocal
set temp="tmp.txt"
rem Copy the list of outdated modules to a text file
call pip list --outdated > %temp%
rem Process the text file to only contain module names
View runescape_99_countdown.py
#!python3
import requests
from urllib.parse import quote
from prettytable import PrettyTable
def measure(user, MAX_XP, MAX_LVL, MAX_ELITE_XP):
SKILL_NAMES = ["Total level", "Attack", "Defence", "Strength", "Constitution",
"Ranged", "Prayer", "Magic", "Cooking", "Woodcutting", "Fletching",
"Fishing", "Firemaking", "Crafting", "Smithing", "Mining",
"Herblore", "Agility", "Thieving", "Slayer", "Farming",
@Diapolo10
Diapolo10 / menu_launcher.py
Created May 22, 2016 — forked from abishur/menu_launcher.py
A simple menu system using python for the Terminal (Framebufer)
View menu_launcher.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Topmenu and the submenus are based of the example found at this location http://blog.skeltonnetworks.com/2010/03/python-curses-custom-menu/
# The rest of the work was done by Matthew Bennett and he requests you keep these two mentions when you reuse the code :-)
# Basic code refactoring by Andrew Scheller
from time import sleep
import curses, os #curses is the interface for capturing key presses on the menu, os launches the files
screen = curses.initscr() #initializes a new window for capturing key presses
curses.noecho() # Disables automatic echoing of key presses (prevents program from input each key twice)
You can’t perform that action at this time.