ModuleWizard script problems

Hi! I’m going to create a new module. I followed a tutorial which told med to download the source code and run the following:

python3 ./Utilities/Scripts/ --template ./Extensions/Testing/ScriptedLoadableExtensionTemplate --target …/ModuleName ModuleName

There are two problems. First, it didn’t work with python3:

Will copy
replacing “{templateKey}” with “{moduleName}”

[‘CMakeLists.txt’, ‘ScriptedLoadableExtensionTemplate.png’, ‘ScriptedLoadableModuleTemplate/CMakeLists.txt’, ‘ScriptedLoadableModuleTemplate/’, ‘ScriptedLoadableModuleTemplate/Resources/Icons/ScriptedLoadableModuleTemplate.png’, ‘ScriptedLoadableModuleTemplate/Testing/CMakeLists.txt’, ‘ScriptedLoadableModuleTemplate/Testing/Python/CMakeLists.txt’]
creating …/TorquilTools/CMakeLists.txt
creating …/TorquilTools/TorquilTools.png
Traceback (most recent call last):
File “/home/torquil/Slicer/./Utilities/Scripts/”, line 123, in
File “/home/torquil/Slicer/./Utilities/Scripts/”, line 117, in main
copyAndReplace(file, template, target, templateKey, moduleName)
File “/home/torquil/Slicer/./Utilities/Scripts/”, line 39, in copyAndReplace
contents =
File “/usr/lib/python3.10/”, line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x89 in position 0: invalid start byte

So I ran this:

python2.7 ./Utilities/Scripts/ --template ./Extensions/Testing/ScriptedLoadableExtensionTemplate --target …/ModuleName ModuleName

but this gave the following error:

File “./Utilities/Scripts/”, line 112
print(f"\nWill copy \n\t{template} \nto \n\t{target} \nreplacing "{templateKey}" with "{moduleName}"\n")
SyntaxError: invalid syntax

Removing an “f” at the beginning of the print() argument seemed to solve the problem. Is that bug?

Will the script also be updated to work with python3?

Best regards,
Torquil Sørensen, Norway