QTableWidget - add from my files to table

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

QTableWidget - add from my files to table

Dodi Ara
i wondering, how can i add from my files to table widget?



for example, i have one file

$ cat a
tes
$

so, the "test" fill in the one or more row or columns

any help will be appreciate
_______________________________________________
python-uk mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-uk
Reply | Threaded
Open this post in threaded view
|

Re: QTableWidget - add from my files to table

Jonathan Hartley
On 20/01/2012 01:19, Dodi Ara wrote:

> i wondering, how can i add from my files to table widget?
>
>
>
> for example, i have one file
>
> $ cat a
> tes
> $
>
> so, the "test" fill in the one or more row or columns
>
> any help will be appreciate
> _______________________________________________
> python-uk mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/python-uk
>

This mailing list is intended more for discussion of Python events and
stuff of interest to people in the UK, rather than for questions about
use. You probably want python-tutor mailing list, which you can read
about here:
http://mail.python.org/mailman/listinfo/tutor

To give a quick answer though, you read the lines from a file using
something like:

with open('filename') as fp:
    for line in fp:
       print line

Then you'll have to read the QTableWidget documentation to find out how
to add those lines to it, instead of printing them.

Best regards,

     Jonathan

--
Jonathan Hartley    [hidden email]    http://tartley.com
Made of meat.       +44 7737 062 225       twitter/skype: tartley


_______________________________________________
python-uk mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-uk