You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, that is correct. The problem relates to the fact that we internatlly just do an execfile() on the Expyriment script and we explicitly set the global dict to the global dict of the file which calls the script (the main.py of the Android Runtime Environment).
We are aware that this is a hack (and a pretty bad one actually, see also: https://lucumr.pocoo.org/2011/2/1/exec-in-python/).
One option to solve this properly would be to always insist on having the Expyriment script wrapped into a main function (as in your example). Doing this we could just import the file as a module and call the main function. The only reason we initially did not do this is because we wanted every Expyriment script to run without modification. Your example shows that this approach failed and I think wrapping everything in a main function is good Python practice anyway.
So, yes, we certainly have to reconsider our current implementation.
Having the experiment in a local namespace will crash the expyriment process with no meaningful error message
The text was updated successfully, but these errors were encountered: