[open] Changing the logfile generic name
Dear OpenSesame developers,
We are running (with success!) experiments on Android tablets and, for the sake of simplicity, I am looking for a way to create in the code the generic name of the logfile (for example: 'exp1' instead of 'subject-' or 'defaultlog'), so that the researchers who are running the experiment just need to input the subject number.
I am aware of the experiment.init function but I am lacking examples...
What should I write, and where?
Is there also a way to suppress the location prompt?
Thank you very much in advance!
Best,
C.
Comments
Hi C,
I don't know much about the Android version, but the generic name for the logfile is defined in this, (line 99) file. If you find it on your system, I guess you can try replacing
subjectwith whatever you prefer.Good luck,
Eduard
Hello Eduard,
Thank you for your fast answer and for your solution.
I was thinking of a way to do so in the OpenSesame experiment (through an inline object, for instance), not in the Python code, as I don't seem to have access to it in Android...
Sorry for the misunderstanding!
Please, let me know if you have a solution!
Best,
Coralie
aah, too bad, I was afraid so. I don't really know how to solve this elegantly, sorry. Another work around might be to close the log file in the very end of the experiment, open it again and save it as another file. To do so, standard python function should be enough.
Well, maybe @Sebastiaan knows a better solution?
Eduard
Thank you for your solution, Eduard.
Sebastiaan, let us know if you have another solution!
Coralie
It might be slightly easier to close and re-open the logfile as the first thing in the experiment. Something like this should do the trick:
Note that
codecs.open()allows for transparent writing of unicode data, but is otherwise the same as plainopen().Not easily. The only way to bypass (or change) the menu is by creating your own
.apkpackage, using thesetup-android.pyincluded with the OpenSesame source code. But that would take a bit of hacking.Check out SigmundAI.eu for our OpenSesame AI assistant!