py2exe "for loop" hangs in compiled program

Discussion in 'Python' started by p_tierchen, Dec 21, 2009.

  1. p_tierchen

    p_tierchen Guest

    Dear reader,

    the application is an interface to a sqlite database and stores image
    metadata (such as year, event, photographer, people on image etc.). i use
    pyqt4 for the interface and developed this application on a linux platform
    (python 2.5.4). friends of mine liked what i have done an want it for their
    windows computers. so i setup a test system (win XP and python 2.6.?).
    copying the code to this system and starting it: works as intended. however
    they complain python whats this, this is sooo complicated etc. so i took
    refuge in using py2exe, planing to give them a zip compressed archive ...
    testing this option i found out that on the surface all looks nice (GUI and
    functions etc) however:
    extending to "larger" datasets (>~50 images) some of the for loops stop
    after some time.
    e.g:
    def update_allImages(self):
    self.set_statusbar(unicode("Daten werden für alle angezeigten Bilder
    eingetragen"))
    for row in range(self.liwi.count()):
    item=self.liwi.item(row)
    md5=item.toolTip()#.split("<")[0]
    md5=unicode(md5.split("<")[0])

    self.md5TOimdata[md5].addyear(self.ui.year_comboBox.currentText())

    self.md5TOimdata[md5].addEvent(self.ui.event_comboBox.currentText())
    self.md5TOimdata[md5].addauth(self.ui.Author_cb.currentText())
    comment=self.ui.CommentInput_text.toPlainText()
    if comment:
    comment.append("; ")
    self.md5TOimdata[md5].addcomment(comment)

    for i in range(self.ui.people_listWidget.count()):
    pitem=self.ui.people_listWidget.item(i)
    name=pitem.text()
    self.md5TOimdata[md5].addperson(name)

    item.setToolTip(self.md5TOimdata[md5].generateToolTip())
    self.liwi.setCurrentItem(item)
    self.md5TOimdata[md5].update_DB()
    self.set_statusbar(unicode("Alles eingetragen: Bereit"))

    sorry for the german strings in the statusbar (to be changed in future
    versions)

    in the third line the problematic "for" starts. at about item 42 or 43 the
    statusbar stays on what is in line 2 and nothing more happens. so the first
    42 items get updated the rest not. well i can restart this process but
    success is limited only view more items get updated. note that this code
    works fine in linux and in windows (python commandline) but hangs as
    described after py2exe.

    a second example is when i try to load many images (~130) again here is a
    for loop iterating over filenames. the pure python versions work as they
    should but not the py2exe.

    def ImLoad(self):
    """ This method is called by clicking on the "load images" button.
    It loads the
    selected images from the source and copies them to the db
    filesystem.
    Of course it is checked whether the image is allready in the db
    (no insertion
    happens) or if its is even loaded (not going to be loaded twice)
    """
    fileNames = QtGui.QFileDialog.getOpenFileNames(self,
    "Bild(er) laden", "", "Bild Dateien (*.png *.jpg *.bmp *.tif)")

    for fileName in fileNames:
    #work is done

    therefore i think its in the" for" loops.

    thanks in advance. just ask if you need more info. kind regards Jo
    --
    View this message in context: http://old.nabble.com/py2exe-"for-loop"-hangs-in-compiled-program-tp26877033p26877033.html
    Sent from the Python - python-list mailing list archive at Nabble.com.
     
    p_tierchen, Dec 21, 2009
    #1
    1. Advertising

  2. p_tierchen

    Aahz Guest

    In article <>,
    p_tierchen <> wrote:
    >
    >the application is an interface to a sqlite database and stores image
    >metadata (such as year, event, photographer, people on image etc.). i
    >use pyqt4 for the interface and developed this application on a linux
    >platform (python 2.5.4). friends of mine liked what i have done an want
    >it for their windows computers. so i setup a test system (win XP and
    >python 2.6.?). copying the code to this system and starting it: works
    >as intended. however they complain python whats this, this is sooo
    >complicated etc. so i took refuge in using py2exe, planing to give them
    >a zip compressed archive ... testing this option i found out that on
    >the surface all looks nice (GUI and functions etc) however: extending
    >to "larger" datasets (>~50 images) some of the for loops stop after
    >some time.


    https://lists.sourceforge.net/lists/listinfo/py2exe-users
    --
    Aahz () <*> http://www.pythoncraft.com/

    "If you think it's expensive to hire a professional to do the job, wait
    until you hire an amateur." --Red Adair
     
    Aahz, Jan 11, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marc
    Replies:
    3
    Views:
    675
    Anand Pillai
    Dec 19, 2003
  2. Pieter Claerhout
    Replies:
    2
    Views:
    574
  3. David Lyon
    Replies:
    0
    Views:
    261
    David Lyon
    Apr 15, 2009
  4. David Lyon
    Replies:
    0
    Views:
    211
    David Lyon
    Apr 15, 2009
  5. Isaac Won
    Replies:
    9
    Views:
    457
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page