csview: A tiny utility to view csv files
Constants
They are better defined outside of functions; there is no need in reinitializing them each call.
Also they are not balanced, fixing it will avoid a weird body = '&lt;tr&gt;\n' + ....
Files management
Just in case the path of the input file contained a dot, I recommend you use rsplit('.', 1).
Also you should try to open the input file before the ouput one. Just in case an error happen during the access to the file, you won't create an empty output file.
And since you're dealing with CSV files, why not use the csv module? It will allow you to handle edge-case data (such as fields containing comas or newlines) easily.
Wrap stuff into tags
Since you're outputing HTML, it may be a better idea to build it as such: by wrapping stuff into tags.
You could define a PATTERN = &quot;&lt;{tag}&gt;{{}}&lt;/{tag}&gt;&quot;  and a formatter:
def formatter(tag):
    return PATTERN.format(tag=tag).format

map that formatter at will to wrap stuff into tags.
Proposed improvements
import webbrowser
import sys
import csv

PATTERN = &quot;&lt;{tag}&gt;{{}}&lt;/{tag}&gt;&quot;

def formatter(tag):
    return PATTERN.format(tag=tag).format

def csv_to_html(csv_file):
    reader = csv.reader(csv_file)

    header = formatter('tr')(
        '\n'.join(map(formatter('th'), next(reader)))
    )

    data = '\n'.join(
        map(formatter('tr'),
            '\n'.join(map(formatter('td'), row))
            for row in reader
        )
    )

    return formatter('table')('\n'.join((header, data)))

if __name__ == &quot;__main__&quot;:
    csv_filename = sys.argv[1]
    html_filename = csv_filename.rsplit('.', 1)[0] + '.html'
    with open(csv_filename) as in_file:
        with open(html_filename, &quot;w+&quot;) as out_file:
            out_file.write(csv_to_html(in_file))
    webbrowser.open(html_filename)