Hi there,
I just started using PsychoPy so sorry in advance if I sound too silly with my questions.
I would appreciate any specific details and instructions since I am very, very new here.
I’m trying to conduct an MSIT experiment using PsychoPy. This is an experiment that should present three digits, including those that begin with zeroes (e.g. 020, 003). I’m using mainly the builder and am importing the stimuli (i.e., the three digits) from an xlsx(Excel) file.
The problem is that the digits showing up on the screen does not include leading zeroes (e.g. showing 20, 3 instead of 020, 003).
Originally, my Excel file also did not present leading zeroes when I wrote the numbers. In order to solve this problem, I tried two methods and both of them worked for my Excel file.
First, I converted the cell data type from digits to text type. Another way was to change the cell style to “000” in a user defined data type.
Then, I tried the solutions suggested in Leading zeroes in text component which was to add $‘%03d’ % MY_VALUE in the text component. However, there was a syntax error.
To sum it up, all three digits show in the Excel file but not in the PsychoPy experiment screen.
Is there any way I can show the full three digits, starting with zero, on the screen?
Or perhaps there is a way I can use the abovementioned $‘%03d’ % MY_VALUE code?
My code from PsychoPy Coder are the following:
Loop2 = data.TrialHandler(nReps=1.0, method=‘random’,
extraInfo=expInfo, originPath=-1,
trialList=data.importConditions(‘MSIT_stimuli.xlsx’),
seed=None, name=‘Loop2’)
thisExp.addLoop(Loop2) # add the loop to the experiment
thisLoop2 = Loop2.trialList[0] # so we can initialise stimuli with some values
abbreviate parameter names if possible (e.g. rgb = thisLoop2.rgb)
if thisLoop2 != None:
for paramName in thisLoop2:
exec(‘{} = thisLoop2[paramName]’.format(paramName))
for thisLoop2 in Loop2:
currentLoop = Loop2
# abbreviate parameter names if possible (e.g. rgb = thisLoop2.rgb)
if thisLoop2 != None:
for paramName in thisLoop2:
exec(‘{} = thisLoop2[paramName]’.format(paramName))
# --- Prepare to start Routine "BlockList1_Control" ---
continueRoutine = True
# update component parameters for each repeat
Stimulus2.setText('020')
Response2.keys = []
Response2.rt = []
_Response2_allKeys = []
Any ideas or solutions will be greatly appreciated! Thank you in advance.