minecraft-bot/mosfet/print_help.py

17 lines
418 B
Python
Raw Normal View History

2021-04-19 03:59:00 +00:00
HELP_LINES = []
2021-04-22 00:46:54 +00:00
with open('mosfet/game.py', 'r') as f:
2021-04-19 03:59:00 +00:00
for line in f.readlines():
if line.strip().startswith('## '):
HELP_LINES.append(line.strip()[3:])
2021-04-19 04:18:40 +00:00
if __name__ == '__main__':
for line in HELP_LINES:
if ' - ' in line:
command, doc = line.split(' - ')
print('`{}` - {}\n'.format(command, doc))
else:
print(line)
print()