Skip to content

Instantly share code, notes, and snippets.

@misode
Created May 9, 2021 08:48
Show Gist options
  • Save misode/47effa5714e73f1373caa859e05a96ab to your computer and use it in GitHub Desktop.
Save misode/47effa5714e73f1373caa859e05a96ab to your computer and use it in GitHub Desktop.
import os
commands = 0
for root, dirs, files in os.walk("."):
for filename in [f for f in files if f.endswith(".mcfunction")]:
with open(os.path.join(root, filename)) as f:
commands += len([l for l in f.readlines() if l[0].isalpha()])
print(commands)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment