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/python
3 import subprocess
4 import sys
5 import os
7 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 command
16 #print command
18 fnull = open(os.devnull, 'w')
19 result = subprocess.call(command, shell = True, stdout = fnull, stderr = fnull)
20 fnull.close()