import csv outfile = file(\'test.csv\', \'w\') writer = csv.writer(outfile, delimiter=\',\', quoting=csv.QUOTE_MINIMAL) writer.writerow([\'hi\',\'dude\']) writer.wri
Note that if you use DictWriter, you will have a new line from the open function and a new line from the writerow function. You can use newline='' within the open function to remove the extra newline.