forked from silshack/summer2017
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ghnames.py
21 lines (18 loc) · 886 Bytes
/
ghnames.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Run this script with `python ghnames.py` until it is correct then
# run `python ghnames.py >> _config.yml` to add it its output to the
# end of our _config.yml. All students will be added as site authors.
# In Python """ starts a string that can span multiple lines
# Add student github names here.
names = """"""
# The data format our blog uses is called YAML. It's a common way of
# getting simple data into a program that processes text.
for name in sorted(names.split("\n"), key=str.lower): # the .split() method makes a list out of a string, split at a character. The sorted() function alphabetizes them.
print """ {0}:
name: {0}
prof: false
gravatar:
website:
github: {0}
twitter:
about: "Here's a little about {0}"
""".format(name) # The format method inserts the nth argument at {n} (starting with the zeroth)