#!/usr/bin/env python
# by claydodo
"""Usage: arangefmt [start:]end[:step] [fmt_str]"""

import sys
import numpy as np

if len(sys.argv) == 1:
    print "Usage: arangefmt [start:]end[:step] [fmt_str]"
    sys.exit(1)

r_str = sys.argv[1].split(':')
r_float = [float(item) for item in r_str]

fmt = '%s'
if len(sys.argv) > 2:
    fmt = sys.argv[2]

start = 0
step = 1

if len(r_float) == 1:
    end = r_float[0]
elif len(r_float) == 2:
    start = r_float[0]
    end = r_float[1]
elif len(r_float) == 3:
    start = r_float[0]
    end = r_float[1]
    step = r_float[2]

# to include the end
end += step / 100

numbers = np.arange(start, end, step)

for item in numbers:
    print fmt % item , 
