This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# \_\_main\_\_.py memo | |
## coverage | |
``` | |
__main__.py => coverage.cmdline.main() => CoverageScript().command_line(argv) | |
``` | |
## nose | |
``` | |
__main__.py => nose.core.run_exit() => main() => TestProgram() (ctor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" mkrefresh.py -- Generate redirecting HTML files. | |
""" | |
from jinja2 import Environment | |
import re | |
from glob import iglob | |
URL='https://showa-yojyo.github.io/notebook/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Scrape "Appendix: Glossary of graph theory" (Wiktionary) | |
Example: | |
$ scrape-graph-glossary.py | sort -d | uniq | |
""" | |
import re | |
import urllib.request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""dq8pot.py: demonstrate MultiDiGraph and related features. | |
""" | |
import networkx as nx | |
import matplotlib.pyplot as plt | |
from matplotlib.font_manager import FontProperties | |
from matplotlib.text import Text | |
from itertools import groupby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""mst.py: demonstrate NetworkX (minimum_spanning_tree) | |
""" | |
import networkx as nx | |
import numpy as np | |
def main(): | |
G = setup_graph(5) | |
dump_spanning(nx.minimum_spanning_tree(G)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""mahjongscoring.py: Output a scoring table to look up the score of | |
a Mahjong hand. | |
Usage: | |
mahjongscoring.py | |
""" | |
from itertools import chain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [12]: %history? | |
Docstring: | |
:: | |
%history [-n] [-o] [-p] [-t] [-f FILENAME] [-g [PATTERN [PATTERN ...]]] | |
[-l [LIMIT]] [-u] | |
[range [range ...]] | |
Print input history (_i<n> variables), with most recent last. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""sankeydemo_mahjong.py: | |
Usage: | |
sankeydemo_mahjong.py | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer