rlm@102: #!/usr/bin/python rlm@102: rlm@102: import subprocess rlm@102: import sys rlm@102: import os rlm@102: rlm@102: target_file = sys.argv[1] rlm@102: rlm@102: command = "emacs -batch -l ~/.emacs-bash " + \ rlm@102: target_file + \ rlm@102: " --eval '(kill-comment (count-lines (point-min) (point-max)))'" rlm@102: rlm@102: #to load a custom .emacs script (for more syntax support), rlm@102: #use -l in the above command rlm@102: rlm@102: #print command rlm@102: rlm@102: fnull = open(os.devnull, 'w') rlm@102: result = subprocess.call(command, shell = True, stdout = fnull, stderr = fnull) rlm@102: fnull.close() rlm@102: rlm@102: rlm@102: rlm@102: rlm@102: rlm@102: rlm@102: rlm@102: