Well, the title pretty much explains it,
I want to read a CSV file and print the file into a GUI Text area.
Or other suitable Widget,
while im at it is there any widget that can display csv Files in a excel sort of syle, in the sense of lots of boxes with data in each one...
or is it possible to put divisions in a textbox do with a textbox.

Recommended Answers

All 3 Replies

To read the CSV you can use the standard open file and readlines into a list. You could then use the split command with the comma to separate the items.

items=lines.split(",")

I am not sure if this is the best way, more advanced programmers may have a better way. I am working on wxPython and the list control, which displays data in an excel style. It wasn't too difficult to get it to display data from a list.

If you install wxpython and run the demo there are examples of grid displays given.

As other posters have said, use the CSV module to work with CSV as it is very flexible as well as being easy to use.

- Paddy.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.