Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] int object is not iterable

edited March 2015 in OpenSesame

Hi all!

I'm programming an experiment in which I have created 8 different image buttons (the image of the buttons are recall referring to the loop list); I need to collect both accuracy and reaction times from them. I have tried to use the inline code but when I run it opensesame gave me the following error:

TypeErrore: 'int' object is not iterable

When I use "fixed" images instead of referring to the loop list this error disappear.
Is there any way to record the data when the image buttons are not "fixed" images?

Thanks in advance!!

Best,
Andrea

Comments

  • edited 2:44PM

    Hi Andrea,

    It is a bit hard to offer you a solution based on the information you provided.
    In general, your error often occurs, if one is trying to loop over a single element of a list, instead of over the entire list. Therefore, I suppose you did something similar when you check your buttons. However, as long as you're not providing a bit more information on the code you are using, I can't really tell what exactly is going wrong.

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited February 2015

    Hi Eduard!

    Thank you so much for your reply and your suggestions! I'm not sure I've completely understood what the problem is...Do you mean that there are some variable on my list that are not include in the loop?
    I attach the code I'm using. After that code I insert a logger with the default options selected.

    from libopensesame import widgets
    
    # Create a form
    form = widgets.form(self.experiment, cols=[1,1,1,1], rows=[1,1], margins=10,10,10,10), spacing=15)
    
    # Create widgets
    image_button1 = widgets.image_button(form, path=self.experiment.get_file(self.get('dist1')), var='dist1')
    image_button2 = widgets.image_button(form, path=self.experiment.get_file(self.get('dist2')), var='dist2')
    image_button3 = widgets.image_button(form, path=self.experiment.get_file(self.get('dist3')), var='dist3')
    image_button4 = widgets.image_button(form, path=self.experiment.get_file(self.get('dist4')), var='dist4')
    image_button5 = widgets.image_button(form, path=self.experiment.get_file(self.get('dist5')), var='dist5')
    image_button6 = widgets.image_button(form, path=self.experiment.get_file(self.get('dist6')), var='dist6')
    image_button7 = widgets.image_button(form, path=self.experiment.get_file(self.get('dist7')), var='dist7')
    image_button8 = widgets.image_button(form, path=self.experiment.get_file(self.get('dist8')), var='dist8')
    
    
    # Add the widgets to the form. 
    form.set_widget(image_button1, (0,0), colspan=1, rowspan=1)
    form.set_widget(image_button2, (0,1), colspan=1, rowspan=1)
    form.set_widget(image_button3, (1,0), colspan=1, rowspan=1)
    form.set_widget(image_button4, (1,1), colspan=1, rowspan=1)
    form.set_widget(image_button5, (2,0), colspan=1, rowspan=1)
    form.set_widget(image_button6, (2,1), colspan=1, rowspan=1)
    form.set_widget(image_button7, (3,0), colspan=1, rowspan=1)
    form.set_widget(image_button8, (3,1), colspan=1, rowspan=1)
    
    
    # Determine the starting time of the form item
    start_time = self.time()
    
    # Execute the form
    button_clicked = form._exec()
    
    # Determine the current time:
    timestamp = self.time()
    
    # Determine RT
    self.experiment.set('response_time', timestamp-start_time)
    

    Sorry for the format of the code! I've tried to upload an image but I wasn't successful!!

    Thank you so much again!!!
    Andrea

  • edited 2:44PM

    Thanks.....


    GuL

  • edited 2:44PM

    Hi Andrea,

    Could you also post at which point the error message occurs? Maybe it is easiest, if you upload the entire experiment and share it here.

    Thanks,

    Eduard

    Buy Me A Coffee

  • edited 2:44PM

    Hi,

    the error occurs before the screen with the eight image_button appears.
    I've also shared the entire experiment; here it's the link:

    http://www.filedropper.com/fullfaces

    Thank you!

    Andrea

  • edited 2:44PM

    Hi Andrea,

    You uploaded an .opensesame file. These files only include the script you wrote, but not the files in the filepool. Therefore, I can't run it (Images are not found). Could you please save the experiment as a opensesame.tar.gz and upload this one again?

    Thanks,

    Eduard

    Buy Me A Coffee

  • edited 2:44PM

    Hi Eduard,

    You're right!! Sorry for the incovenience!! Here it is:

    http://www.filedropper.com/fullfacesopensesametar

    Thank you so much,
    Andrea

  • edited 2:44PM

    Hi Andrea,

    I just tried your experiment, and it works without any trouble. Are you sure that you haven't "accidentally" solved the issue already by yourself?
    What version of OpenSesame are you running? Maybe if you update it to 2.9.4, it will work (that's the one I am running right now).
    If you can reproduce the error, can you post the error message here? Maybe this will help to see what goes wrong in your case.

    Thanks,

    Eduard

    Buy Me A Coffee

  • edited 2:44PM

    Hi Eduard,

    I have tried my experiment again (the same I've uploaded) and it gives me the same error.
    Actually, I'm running the 2.9.2 version of OpenSesame; so I'll update my version of OpenSesame and try it again!
    Meanwhile I post here the error message the experiment gives to me:

    http://img.cogsci.nl/?q=550702bd04c21

    Thank you so much!

    Andrea

  • edited 2:44PM

    I've update my version of OpenSesame to 2.9.4 and tried it again, but it still gives me the same error.
    I don't really know what could be....could the backend make any difference?

  • edited 2:44PM

    Hi Andrea,

    You ran into an unfortunate combination of weird images and a bug in OpenSesame. On some systems (Windows, but not Linux), OpenSesame fails to read your images using the standard mechanism. If that happens, it falls backs to a different mechanism. But the fallback mechanism had a bug, which resulted in the weird error message.

    So the solution would be to either:

    • Update to the latest prerelease of 2.9.5 (>= pre6), which should fix this issue.
    • Use a different image format, such as .png.

    could the backend make any difference

    This is not really related to this issue, but yes, different back-ends support different image formats. But all common formats are supported by all back-ends.

    Cheers,
    Sebastiaan

  • edited 2:44PM

    Hi Sebastiaan,

    oh I see! I've change the image format to .png and now the experiment works!

    Thank you so much!

    Andrea

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games