Code below is for Python 3. If you use Python 2, import izip_longest instead of zip_longest.
import csv
from itertools import zip_longest
d = [[2,3,4,8],[5,6]]
with open("file.csv","w+") as f:
writer = csv.writer(f)
for values in zip_longest(*d):
writer.writerow(values)