Howdy, Stranger!

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

Supported by

python crash at the end of the experiment

I have created this nice piece of code to assess handedness (Oldfield, 1971).

However, it makes my experiment crash at the very end. No matter where i put the code (beginning, middle, or the end). The experiment works well 'till the end. And then... "Python seems to have crashed. This should not happen. If Python crashes often, please report it on the OpenSesame forum."

var.Phase='Handedness'

def handedness_validator():

    """Checks whether all actions have been filled out"""
    return (
    (var.Hand_1L != u'no' or var.Hand_1R != u'no') and
    (var.Hand_2L != u'no' or var.Hand_2R != u'no') and
    (var.Hand_3L != u'no' or var.Hand_3R != u'no') and
    (var.Hand_4L != u'no' or var.Hand_4R != u'no') and
    (var.Hand_5L != u'no' or var.Hand_5R != u'no') and
    (var.Hand_6L != u'no' or var.Hand_6R != u'no') and
    (var.Hand_7L != u'no' or var.Hand_7R != u'no') and
    (var.Hand_8L != u'no' or var.Hand_8R != u'no') and
    (var.Hand_9L != u'no' or var.Hand_9R != u'no') and  
    (var.Hand_10L != u'no' or var.Hand_10R != u'no') )

# Define all widgets
button_ok = Button(text=u'Ok')
label_0 = Label(u'Bitte machen Sie einmal vor, wie sie...')
#label_01 = Label(u'linke Hand')
#label_02 = Label(u'rechte Hand')
label_1 = Label(u'...schreiben')
checkbox_1L = Checkbox(text=u'linke Hand',  var=u'Hand_1L')
checkbox_1R = Checkbox(text=u'rechte Hand', var=u'Hand_1R')
label_2 = Label(u'...zeichnen')
checkbox_2L = Checkbox(text=u'linke Hand',  var=u'Hand_2L')
checkbox_2R = Checkbox(text=u'rechte Hand', var=u'Hand_2R')
label_3 = Label(u'...einen Ball werfen')
checkbox_3L = Checkbox(text=u'linke Hand',  var=u'Hand_3L')
checkbox_3R = Checkbox(text=u'rechte Hand', var=u'Hand_3R')
label_4 = Label(u'...mit einer Schere schneiden')
checkbox_4L = Checkbox(text=u'linke Hand',  var=u'Hand_4L')
checkbox_4R = Checkbox(text=u'rechte Hand', var=u'Hand_4R')
label_5 = Label(u'...sich die Zähne putzen')
checkbox_5L = Checkbox(text=u'linke Hand',  var=u'Hand_5L')
checkbox_5R = Checkbox(text=u'rechte Hand', var=u'Hand_5R')
label_6 = Label(u'...mit dem Messer Brot schneiden')
checkbox_6L = Checkbox(text=u'linke Hand',  var=u'Hand_6L')
checkbox_6R = Checkbox(text=u'rechte Hand', var=u'Hand_6R')
label_7 = Label(u'...mit dem Löffel essen')
checkbox_7L = Checkbox(text=u'linke Hand',  var=u'Hand_7L')
checkbox_7R = Checkbox(text=u'rechte Hand', var=u'Hand_7R')
label_8 = Label(u'...mit dem Besen fegen')
checkbox_8L = Checkbox(text=u'linke Hand',  var=u'Hand_8L')
checkbox_8R = Checkbox(text=u'rechte Hand', var=u'Hand_8R')
label_9 = Label(u'...ein Streichholz anzünden')
checkbox_9L = Checkbox(text=u'linke Hand',  var=u'Hand_9L')
checkbox_9R = Checkbox(text=u'rechte Hand', var=u'Hand_9R')
label_10 = Label(u'...den Deckel von einer Dose schrauben')
checkbox_10L = Checkbox(text=u'linke Hand',  var=u'Hand_10L')
checkbox_10R = Checkbox(text=u'rechte Hand', var=u'Hand_10R')
# Build the form. Specify a validator function to make sure that the form is
# completed.
handedness = Form(  validator=handedness_validator, cols=[2,1,1,1], rows=13, spacing=10, margins=(10, 100, 100, 100),   )
#my_form.set_widget(label_gender, (0, 0))
handedness.set_widget(label_0, (0, 1))
#handedness.set_widget(label_01, (2, 0))
#handedness.set_widget(label_02, (3, 0))

handedness.set_widget(label_1, (0, 2))
handedness.set_widget(checkbox_1L, (2, 2))
handedness.set_widget(checkbox_1R, (3, 2))
handedness.set_widget(label_2, (0, 3))
handedness.set_widget(checkbox_2L, (2, 3))
handedness.set_widget(checkbox_2R, (3, 3))
handedness.set_widget(label_3, (0, 4))
handedness.set_widget(checkbox_3L, (2, 4))
handedness.set_widget(checkbox_3R, (3, 4))
handedness.set_widget(label_4, (0, 5))
handedness.set_widget(checkbox_4L, (2, 5))
handedness.set_widget(checkbox_4R, (3, 5))
handedness.set_widget(label_5, (0, 6))
handedness.set_widget(checkbox_5L, (2, 6))
handedness.set_widget(checkbox_5R, (3, 6))
handedness.set_widget(label_6, (0, 7))
handedness.set_widget(checkbox_6L, (2, 7))
handedness.set_widget(checkbox_6R, (3, 7))
handedness.set_widget(label_7, (0, 8))
handedness.set_widget(checkbox_7L, (2, 8))
handedness.set_widget(checkbox_7R, (3, 8))
handedness.set_widget(label_8, (0, 9))
handedness.set_widget(checkbox_8L, (2, 9))
handedness.set_widget(checkbox_8R, (3, 9))
handedness.set_widget(label_9, (0, 10))
handedness.set_widget(checkbox_9L, (2, 10))
handedness.set_widget(checkbox_9R, (3, 10))
handedness.set_widget(label_10, (0, 11))
handedness.set_widget(checkbox_10L, (2, 11))
handedness.set_widget(checkbox_10R, (3, 11))

handedness.set_widget(button_ok, (2, 12))

handedness._exec()

log.write_vars()

Suggestions for a more effective way to write this are welcomed.
Stephan

Comments

  • Hi Stephan,

    This error ("Python seems to have crashed") is never because you did something wrong. It always reflects a bug somewhere in the low-level libraries used by OpenSesame, or even Python itself (but the former is more likely), that causes the entire Python interpreter to crash. This error occurs at a different level from when a Python script (or OpenSesame experiment) crashes inside the Python interpreter, if that makes sense. It's very difficult to debug this.

    In your case, do you experience any negative side-effects? It sometimes happens that Python crashes right when shutting down, and in that case it's annoying, but doesn't really matter.

    Cheers!
    Sebastiaan

  • Hi Sebastiaan,

    you are right. It's annoying, but not really a problem. :p
    I now figured out that the bug only occurs in the 'quick run' but not in 'Run fullscreen'. Hence, it's even less a problem.

    To your answer: Sometimes the python crash is caused by errors in the code. If i get the python crash message, i always try to run it several times. And in some cases i get a more specific error report in the second/third try. Usually that happens when i forgot something stupid like not typing () after showor log.write_vars

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