Howdy, Stranger!

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

Supported by

[solved] Problems with complex experiment

edited June 2014 in OpenSesame

I will first say that anyone willing to help me on this is likely a saint. This is not an easy task and I have all but given up on this (and therefore humbly ask for help). I have elected to use mostly python scripting for this project. I have two problems to solve for this project:

  1. The project, in its current state, gives an error message that it never has given before on the line:
    if exp.get("result") == "g0s" and exp.get("bearpos") > 0:

It tells me that there is a syntax error. I am not sure what the problem would be with this

  1. I would like to use pyzmq bindings to be able to communicate data between two computers and get information to use in further steps.

I can answer any questions people have over the project. At this moment I am trying to convince myself to not go back to E-Prime, but if this doesn't work there really isn't a choice.

I have the full experiment uploaded to Google Docs here:

https://drive.google.com/file/d/0ByTs94UTlkOJUnZoS2phRVRnTU0/edit?usp=sharing

I can answer any questions you have. Thank you in advance for any help provided.

Edit:
I am running Ubuntu 14.04 with the latest version of opensesame.

image
(not sure if this helps)

Comments

  • edited May 2014

    Although I haven't looked at your script, I can tell you where the error is likely to come from: a missing bracket somewhere before line 125. Even though it only crashes here, it probably does so because up to that point, the syntax has been interpreted as correct. An example:

    a = 1
    test = (1,2 # <- this is where the actual error is: a missing bracket!
    
    if a == 1: # <- this is where Python thinks the error is, because the code is syntactically correct up to the colon
        print a
    

    Will produce an error like the following, which is exactly the same as yours:

    Traceback (most recent call last):
      File "example.py", line 4
        if a == 1:
                 ^
    SyntaxError: invalid syntax
    

    On your second problem: pyzmq is not bundled together with the standalone version of OpenSesame, but you could add it to the portable version.

    Good luck!

  • edited May 2014

    Hi Edwin,

    I have looked over the code and your suggestion helped me the initial problem. I appreciate your help on that. I was, however wondering if there was an easier way to import information to be used by the experiment. I was wondering if the input function or raw_input would work. I have tried this by importing sys. I keep getting a EOFError. I am not sure how to work on this further. Do I need the portable version and to import a package or something? To be clear I would like to be able to use the debug window to input information to be used in the experiment. Is there a good way to do this?

    I appreciate the help so far. Thank you.

  • edited 3:06PM

    Good to hear you've found the bug in your code.

    There are tons of ways to import stuff into your experiment. The best solution depends on what kind of information you need to add in there. input and raw_input might not prove to be optimal, as OpenSesame takes over the full screen before you could actually type stuff. You could, however, use a (form_)text_input item, or load information from a textfile. Communication between two computers might be easiest through the socket module.

    If you give us a bit more information on what you plan to do, we could give you some pointers.

    Good luck!

  • edited 3:06PM

    This is old and is closed. Thank you

  • edited 3:06PM

    Thanks for the heads-up, we'll mark this as solved!

Sign In or Register to comment.