{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import re" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [], "source": [ "list_of_filenames = [\n", " \"[todo] 2022-04-21-if-you-use-git-you-should-be-very-liberal-in-deleting-stale-code.markdown\",\n", " \"[UNP] 2022-04-21-will-somebody-please-think-of-the-labels-lessons-learned-in-applied-ml.markdown\",\n", " \"[WIP] 2021-11-21-some-thoughts-on-software-complexity.markdown\",\n", " \"[TODO] 2022-04-21-if-you-use-git-you-should-be-very-liberal-in-deleting-stale-code.markdown\",\n", " \"[unp] 2021-04-21-yada-yada.markdown\",\n", " \n", "]" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['[UNP] 2022-04-21-will-somebody-please-think-of-the-labels-lessons-learned-in-applied-ml.markdown',\n", " '[todo] 2022-04-21-if-you-use-git-you-should-be-very-liberal-in-deleting-stale-code.markdown',\n", " '[TODO] 2022-04-21-if-you-use-git-you-should-be-very-liberal-in-deleting-stale-code.markdown',\n", " '[WIP] 2021-11-21-some-thoughts-on-software-complexity.markdown',\n", " '[unp] 2021-04-21-yada-yada.markdown']" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sorted(list_of_filenames, key=lambda a: re.sub(r\"\"\"(?i)^\\[\\w+\\]\\s*\"\"\", \"\", a), reverse=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## \"NameError: name '\\_\\_file\\_\\_' is not defined\"\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.8.10" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }