#!/usr/bin/env python3

import sys
import os

import pandas as pd

script = sys.argv[0]
args = sys.argv[1:]

def usage():
    return "%s FILE...\n" % os.path.basename(script)

if len(args) < 1:
    sys.stderr.write(usage())
    sys.exit(1)

for arg in args:
    file_name, file_extension = os.path.splitext(arg)

    if not file_extension.lower() == ".csv":
        sys.stderr.write("Skipping %s.\n" % arg)
        continue

    csv_file = pd.read_csv(arg)
    csv_file.to_excel(file_name + ".xls",index = False
        ,header = False)
