Update pytudes.py

This commit is contained in:
Peter Norvig 2024-04-09 16:14:03 -07:00 committed by GitHub
parent c9947af8dd
commit 7b0e405de8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -131,6 +131,8 @@ python_files = [
('yaptu.py', 'Yet Another Python Templating Utility'), ('yaptu.py', 'Yet Another Python Templating Utility'),
] ]
###############################################################################################################
import re import re
import urllib.request import urllib.request
@ -148,8 +150,8 @@ def check():
"""Check that the listing of *.ipynb files matches the README.md file""" """Check that the listing of *.ipynb files matches the README.md file"""
readme = ipynbs(read_url("https://raw.githubusercontent.com/norvig/pytudes/main/README.md")) readme = ipynbs(read_url("https://raw.githubusercontent.com/norvig/pytudes/main/README.md"))
listing = ipynbs(read_url("https://github.com/norvig/pytudes/tree/main/ipynb")) listing = ipynbs(read_url("https://github.com/norvig/pytudes/tree/main/ipynb"))
unfinished = 'Palindrome.ipynb', 'SET.ipynb', 'Sudoku IPython Notebook.ipynb' unfinished = {'Palindrome.ipynb', 'SET.ipynb', 'Sudoku IPython Notebook.ipynb'}
subbooks = 'BikeCode.ipynb', 'ElectoralVotesCode.ipynb', subbooks = {'BikeCode.ipynb', 'ElectoralVotesCode.ipynb'}
def show(msg, nbs): print(msg+':', *nbs) if nbs else None def show(msg, nbs): print(msg+':', *nbs) if nbs else None
show('Unfinished', unfinished) show('Unfinished', unfinished)
show('Missing files', readme - listing) show('Missing files', readme - listing)
@ -206,6 +208,7 @@ def format_python(url, description, doc='') -> str:
if doc: doc = f'[documentation]({doc})' if doc: doc = f'[documentation]({doc})'
return f'|[{url}](/py/{url})|*{description}*|{doc}|' return f'|[{url}](/py/{url})|*{description}*|{doc}|'
###############################################################################################################
body = f""" body = f"""
<div align="right" style="text-align:right"><i>Peter Norvig <div align="right" style="text-align:right"><i>Peter Norvig