#!/usr/bin/env python
# -*- coding: utf8 -*-

# My imports
from __future__ import division, print_function
import numpy as np
import argparse


def ll_filter(fname, col, limit, sign, element):
    data = np.loadtxt(fname, skiprows=1, unpack=True)
    if sign > 0 and element:
        i = (data[col] > limit) | (data[1] == element)
    elif sign < 0 and element:
        i = (data[col] < limit) | (data[1] == element)
    elif sign > 0 and not element:
        i = data[col] > limit
    elif sign < 0 and not element:
        i = data[col] < limit

    return data[:, i].T


def _parser():
    parser = argparse.ArgumentParser(description='Filter the linelist by a'
                                     ' column and an upper limit')
    parser.add_argument('input', help='Input linelist')
    parser.add_argument('col',
                        help='Column to be sorted (starting at 0)',
                        type=int)
    parser.add_argument('limit',
                        help='The upper limit on the column',
                        type=float)
    parser.add_argument('-o', '--output',
                        help='The output linelist',
                        default=None)
    parser.add_argument('-s', '--sign',
                        help='Positive (default) for including values above,'
                        ' negative for including values below',
                        default=1,
                        type=int)
    parser.add_argument('-e', '--element',
                        help='If value is 26.1 then FeII lines will'
                        ' not be removed.',
                        default=None,
                        type=float)
    args = parser.parse_args()
    return args


if __name__ == '__main__':
    args = _parser()

    fname = args.input
    col = args.col
    limit = args.limit
    sign = args.sign
    element = args.element
    if not args.output:
        t = fname.split('.')
        t[0] += '_filtered_%s_%s' % (col, limit)
        output = '.'.join(t)
    else:
        output = args.output

    data = ll_filter(fname, col, limit, sign, element)
    print('Result saved in %s' % output)
    np.savetxt(output, data,
               fmt=('%9.3f', '%10.1f', '%9.2f', '%9.3f', '%28.1f'),
               header='Wavelength\tEle\t  excit\t  log gf\t\t\t EW',
               comments='')

@@ -248,28 +248,24 @@
     if sign 
-%3E 0 
 and element:
@@ -257,32 +257,32 @@
 gn and element:%0A
+
         i = (dat
@@ -325,32 +325,32 @@
 t)%0A    elif 
+not 
 sign
- %3C 0
  and element
@@ -424,12 +424,8 @@
 ign 
-%3E 0 
 and 
@@ -480,16 +480,16 @@
 lif 
+not 
 sign
- %3C 0
  and
@@ -1383,17 +1383,20 @@
 default=
-1
+True
 ,%0A      
@@ -1409,32 +1409,69 @@
             
-type=int
+action='store_false'%0A                        
 )%0A    parser

Use -s as a flag for on/off instead of passing -1 all the time.