Repo for A Tune In workshop by amy, Aggeliki and Cristina for the Any One Day The Future Died conference.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.6 KiB

2 years ago
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "9e50b7b2",
"metadata": {},
"outputs": [],
"source": [
"import random\n",
"import time\n",
"import json\n",
"import wget\n",
"\n",
"url = \"https://pad.vvvvvvaria.org/any_one_day_this_dictionary_has_died/export/txt\"\n",
"wget.download(url, 'any_one_day_this_dictionary_has_died.json')\n",
" \n",
"with open('any_one_day_this_dictionary_has_died.json', 'r') as f:\n",
" wordmord = json.loads(f.read().replace(\"'\", '\"'))\n",
"\n",
"#print(wordmord['death']['para-etymology'][0])\n",
"\n",
"sentence = input('give me your words / δώσε μου κείμενο: ')\n",
"\n",
"def makedemonic():\n",
"\tnew_sentence = sentence\n",
"\tfor word in wordmord:\n",
"\t\tif word in new_sentence:\n",
"\t\t\tnew_sentence = new_sentence.replace(word, random.choice(wordmord[word]['paramyms']))\n",
"\tprint(new_sentence)\n",
"\n",
"def makepara():\n",
"\tnew_sentence = sentence\n",
"\tfor word in wordmord:\n",
"\t\tif word in new_sentence:\n",
"\t\t\tnew_sentence = new_sentence.replace(word, random.choice(wordmord[word]['parameanings']))\n",
"\tprint(new_sentence)\n",
"\n",
"def makepira():\n",
"\tnew_sentence = sentence\n",
"\tfor word in wordmord:\n",
"\t\tif word in new_sentence:\n",
"\t\t\tnew_sentence = new_sentence.replace(word, random.choice(wordmord[word]['paradoxes']))\n",
"\tprint(new_sentence)\n",
"\n",
"\n",
"type = input('choose type of transformation / τύπος μετάλλαξης: ')\n",
"\n",
"if type == 'demonic':\n",
"\tmakedemonic()\n",
"elif type == 'para':\n",
"\tmakepara()\n",
"elif type == 'pira':\n",
"\tmakepira()\n",
"else:\n",
"\tmakedemonic()\n",
"\ttime.sleep(1)\n",
"\tmakepara()\n",
"\ttime.sleep(1)\n",
"\tmakepira()\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "2b7227d4",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "add48660",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}