Skip to content

Instantly share code, notes, and snippets.

# Write your code here :-)
# l = ['Tim', 'David', 'Peter', 'Tommy']
# for i in l:
# print(int(i))
# iterator = iter(l)
# while True:
# try:
# print(next(iterator))
import pathlib
import random
#
# Get a list of category filenames
#
category_filenames = pathlib.Path(".").glob("*.txt")
#
# Display each category name in turn
@tjguk
tjguk / p.py
Created November 14, 2020 15:20
Parsing text for adventure
import os, sys
import re
text = 'utilise the big red ball.'
#~ phone_text = "My phone number is 07749 298683 and my phone number is 012342837 89 and this is another number 13245767802"
verbs = {"go", "get", "drop", "jump", "eat", "use"}
synonyms = {
"use" : {"wave", "utilise", "brandish"}
}
ABANDON
ABANDONED
ABANDONING
ABANDONS
ABASHED
ABBEY
ABEAR
ABILITIES
ABILITY
ABJURED
<!DOCTYPE html>
<html lang="en">
<head>
<title>Form</title>
</head>
<body>
<form method="POST">
<label for="name1">Name 1:</label><br>
<input value="{{name1}}" type="text" id="name1" name="name1"> - {{receiver1}} <br>
@tjguk
tjguk / desaturate.py
Created September 14, 2019 15:24
Changing the saturation of an image
#
# You nearly always just need to import Image
# from PIL(low) to do what you need
#
from PIL import Image
#
# It's convenient to import everything from colorzero
# so you don't have to put "colorzero." before everything
#
from colorzero import *