Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Comment¶
pathlib.Path.glob is preferred to the
globmodule!!The list returned is not sorted.
import globfiles = glob.glob("*.markdown")
files[:5]['2019-10-13-git-shell-on-windows.markdown',
'2012-10-22-containers-in-java.markdown',
'2019-10-01-tips-on-pyspark.markdown',
'2020-03-03-common-issues-in-pytorch.markdown',
'2014-09-14-some-terminologies-in-aml.markdown']sorted(files)[:5]['2010-11-20-general-tips-for-latex.markdown',
'2012-05-17-java-difference-abstract-interface.markdown',
'2012-06-05-free-online-tools-for-developers.markdown',
'2012-06-08-softwares-windows.markdown',
'2012-06-10-operators-popular-language.markdown']glob.glob("*pop*")['2019-02-17-popular-data-structures-in-python.markdown',
'2020-02-25-popular-and-useful-modules-and-functions-in-pytorch.markdown',
'2012-06-10-operators-popular-language.markdown']