[PyQt] linking subprocess function and items in listwidget?

Till Gerken till.gerken at gmail.com
Mon Mar 16 15:01:52 GMT 2009


On Mon, Mar 16, 2009 at 11:32 AM, klia <alwaseem307ster at yahoo.com> wrote:
> I have function myexif.py that extracts exif data from photos into .csv
> file, i have subprocess this function into this form under a bush button
> (add photo)
>
> p= Popen(["python","myexif.py","-q","photopath"],
> stdout=file("test.csv","w"))
> p.wait()
>
> I am suppose to select one or more photos in the listwidget and execute my
> (add photo) button which will extracts exif data from the photos selected,
> but i am facing problem on how to get the function above to know the path of
> my selected photos in the listwidget?

Using a QListWidget, you will either have to add the items with their
full path to the list or use a common directory root. If that is not
possible, use a QListView and your own data model. A custom data model
allows you to keep the list entry and path to the file name as
separate entities.

http://doc.trolltech.com/4.4/model-view-programming.html

Till


More information about the PyQt mailing list