Howdy, Stranger!

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

Supported by

[open] Get subject number and name of logfile from textfile

edited October 2013 in OpenSesame

Hi all,

I'm pretty new to OpenSesame, I just completed the tutorial today. Is it possible to skip the two dialog screens when running an experiment (asking for a subject number and location/name of logfile respectively), and get that information from another source? I'm thinking a python script that reads a simple text file with the information for the subject number and location/name of logfile?

Comments

  • edited July 2021

    Hi,

    The GUI always asks for the subject number and logfile location. So from the OpenSesame GUI, no, there's no way around this. But you can bypass these dialogs using opensesamerun. This is a runtime-only version of OpenSesame which allows you to launch experiments from the command line:

    A more advanced option is to launch experiments directly from a Python script using the Python package libopensesame:

    This last option requires that you have a full Python environment installed and run OpenSesame from source. An easy way to accomplish this is using the WinPython OpenSesame package:

    Hope this helps!

    Cheers,
    Sebastiaan

  • Hi all,

    As for FVMF, I wondered whether Opensesame could import the ID Subject from an external file as a Database or CSV?

    I have seen that this kind of topic was already addressed, but for Android device and OsWeb app, since I will use for our experiment the classic windows Opensesame app, any implementation advice would be appreciated.

    Looking forward to hearing news from you soon 

    All the best

    Michael

  • Hi @Michael_Di_Palma ,

    Your best bet is still to use opensesamerun and specify the subject number and log file as command-line arguments. Then you can write a script (e.g. in Python or a Windows batch file) that reads the subject number from a database or csv and uses that to call opensesamerun with the correct arguments. The details of course depend on what you want to do exactly, but as a general approach this makes sense.

    — Sebastiaan

  • Dear Sebastian,

    First of all, I would like to thank you for your prompt reply.

    As suggested, we have managed to use opensesamerun by a python script. Unfortunately, when we execute (by double click) the file .py on a machine where only Rapunzel is installed, this opens the file but does not directly execute it. On the other hand, when we do the same procedure on a machine with Anaconda (i.e. Spyder), the script is directly executed without opening the file.

    Thus, we wondered if Rapunzel can alone execute the script or always need a complete python environment.

    Looking forward to hearing news from you soon

    All the best

    Michael

  • Hi @Michael_Di_Palma ,

    As suggested, we have managed to use opensesamerun by a python script. Unfortunately, when we execute (by double click) the file .py on a machine where only Rapunzel is installed, this opens the file but does not directly execute it. On the other hand, when we do the same procedure on a machine with Anaconda (i.e. Spyder), the script is directly executed without opening the file.

    That's related to the application that's associated with a file type. Right now, on your system Rapunzel seems to be associated with .py files, which is the default behavior of the OpenSesame installer. And Anaconda apparently (based on your description) by default associates .py files with the Python interpreter.

    You should be able to change this by right-clicking on a .py file, select 'Open with' → 'Choose another app', and then select python.exe from the OpenSesame program folder.

    Hope this helps!

    — Sebastiaan

Sign In or Register to comment.