Alright, so I have another question now. For a school-related project, I am making an evaluation program. It has to save results to a CSV file. I have never worked with CSV before, so this is all new to me. I have figured out how to write the data to file however. But I also have to be able to generate a report with the data from the CSV. I am going to use a ListCtrl. Maybe this isnt the most efficient way, but I want to populate the ListCtrl from a dictionary, (one dict per line), and I want to make the dictionaries from the CSV file (also one dict per line). Is this the best way to fill a listctrl from a CSV? Is there a way to fill dictionaries from CSV? Is there a way to populate a ListCtrl from dictionaries? Thanks!

There is a CSV module in the python standard library and it has a DictReader & DictWriter methods read up on it hereCheck out Objectlistview for showing list data, it makes it much easier to fill out the list from a dictionary.

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

Looks like Ive got some reading to do! Thanks! BTW, I was planning to use ObjectListView already for some other parts, but didn't realize it could fill from a dict as well. That is even better! Thanks!

ms4sman wrote:Looks like Ive got some reading to do! Thanks! BTW, I was planning to use ObjectListView already for some other parts, but didn't realize it could fill from a dict as well. That is even better! Thanks!

Take a look in the examples folder that comes with objectlistview, there is a python file UsingDictionaryExample.py and there is various others in there too if you didn't know about them.

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

Thank you that makes sense.Back on the topic of ObjectListView, the way I decided to code it, I ended up loading the values into a list instead of a dictionary. I don't see a way to do it, although I am sure there is. How would I populate the listctrl from a list instead of a dictionary?

EDIT: I thought maybe I should clarify what I am trying to do. I have one list for each column in my CSV file. I want to take those list/columns and use them to populate a ListCtrl.

And here is an example CSV file with one record in it:"eval_num","empe_num","empr_num","eval_date","next_eval","qual_score","qual_comm","habits_score","habits_comm","knowledge_score","knowledge_comm","behavior_score","behavior_comm","ave_score","overall_score","overall_comm","emp_rec""5998","0005","0027","02-17-13","02/17/13 13:09:49","4","Generally no mistakes","4","Occasionally gets distracted","5","Very intelligent about job","3","Often gets in arguments","4.0","4","Overall, a good worker with a few quirks","False"

Maybe I'm misunderstanding you. I already have the CSV stuff loaded into the lists. one list for every column. Now i am trying to use objectlistview to populate a list control with those lists, one list for each column. Maybe that is what you said, but I guess I don't understand.

I know that is not even close to what I want, but I don't know how to load it right. Here is the CSV:

"eval_num","empe_num","empr_num","eval_date","next_eval","qual_score","qual_comm","habits_score","habits_comm","knowledge_score","knowledge_comm","behavior_score","behavior_comm","ave_score","overall_score","overall_comm","emp_rec""5998","0005","0027","02-17-13","02/17/13 13:09:49","4","Generally no mistakes","4","Occasionally gets distracted","5","Very intelligent about job","3","Often gets in arguments","4.0","4","Overall, a good worker with a few quirks","False"

Once in a dictionary, I want to use the dictionaries to populate a ListCtrl somehow. It could be with objectlistview, or not. I don't really care.

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.