Mini-DataBase with CSV file
In these days, I was looking for creating a little CSV file where I can save some inputs, so when I restart my program it will start with my CSV pre-setted loadout. I found the module csv and I've done a script like this: import csv with open('test.csv', 'w') as myFile: myFields = ['email', 'nickname', 'delay'] writer = csv.DictWriter(myFile, fieldnames=myFields) writer.writeheader() writer.writerow({'email': 'number-one@gmail.com', 'nickname': 'n1', 'delay': 'low'}) It works because I can choose with what setup my program is starting and I also can change some factors easly. But there's a little problema: I don't like how it looks! In fact, It results like this: email,nickname,delay number-one@gmail.com,n1,low So, is there a method to set the csv file like this instead? email, number-one@gmail.com nickname,n1 delay,low I know there's a simple method: just inverting myFields from ['email', 'nickname', 'delay'] to ['email', 'number-one@gmail.com''], but it's not what I would! It seems like the csv module gives more importance to the top a column that to the start of a row. In conclusion, can I set myFields not to the top of a column but to the row's start? Thanks in advice and tell me if there are missunderstandings :)))