Skip to content

Instantly share code, notes, and snippets.

View lewis-carson's full-sized avatar

Lewis Carson lewis-carson

  • 03:06 (UTC +01:00)
View GitHub Profile
@lewis-carson
lewis-carson / alice.py
Last active December 10, 2017 09:34
A lightweight music player that runs in the console. Use the mode as 's' for shuffle or 'p' for normal play. Add 'r' to the end of the mode to make it repeat. Ctrl + C brings you to the start.
import winsound
import os
import random
from colorama import Fore, Back, Style
def printc(text):
print(Fore.RED + text)
print(Fore.WHITE)
def shuffledir(dir, repeat):
#shuffle
@lewis-carson
lewis-carson / crawler.py
Created November 6, 2017 17:16
lightweight web crawler
from bs4 import BeautifulSoup
import random
import requests
import re
class crawler():
def findurls(self, limit, seed):
cache = seed
history = []
for idx, currenturl in enumerate(cache):