Mercurial > laserkard
view temp342423/kill-comments @ 102:8ed3394e6b73 laserkard
wrote comment-killer
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 27 Jul 2010 22:23:13 -0400 |
parents | |
children |
line wrap: on
line source
1 #!/usr/bin/python3 import subprocess4 import sys5 import os7 target_file = sys.argv[1]9 command = "emacs -batch -l ~/.emacs-bash " + \10 target_file + \11 " --eval '(kill-comment (count-lines (point-min) (point-max)))'"13 #to load a custom .emacs script (for more syntax support),14 #use -l <file> in the above command16 #print command18 fnull = open(os.devnull, 'w')19 result = subprocess.call(command, shell = True, stdout = fnull, stderr = fnull)20 fnull.close()