Created
September 24, 2013 02:10
-
-
Save oiuww09fn/6679496 to your computer and use it in GitHub Desktop.
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
# -*- coding: utf-8 -*- | |
# export the book Learn Vimscript the Hard Way | |
# git clone https://github.com/sjl/learnvimscriptthehardway.git | |
# copy the file in learnvimscriptthehardway folder. | |
import os | |
ROOTPATH = os.path.dirname(__file__) | |
for i, j, k in os.walk(os.path.join(ROOTPATH, "chapters")): | |
books = k | |
books.sort() | |
final_book = open(os.path.join(ROOTPATH, "Vimscript.md"), "w") | |
for i in range(57): | |
txt = open(os.path.join(ROOTPATH, "chapters", books[i]), "r").readlines() | |
for k, j in enumerate(txt): | |
if k == 0: | |
j = "%s. %s" % (i, j) | |
final_book.write(j) | |
final_book.write("\n******************\n") | |
print "finish!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment