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/ModuleWizard.py --template ./Extensions/Testing/ScriptedLoadableExtensionTemplate --target …/ModuleName ModuleName

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

Will copy
{template}
to
{target}
replacing “{templateKey}” with “{moduleName}”

[‘CMakeLists.txt’, ‘ScriptedLoadableExtensionTemplate.png’, ‘ScriptedLoadableModuleTemplate/CMakeLists.txt’, ‘ScriptedLoadableModuleTemplate/ScriptedLoadableModuleTemplate.py’, ‘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/ModuleWizard.py”, line 123, in
main(sys.argv[1:])
File “/home/torquil/Slicer/./Utilities/Scripts/ModuleWizard.py”, line 117, in main
copyAndReplace(file, template, target, templateKey, moduleName)
File “/home/torquil/Slicer/./Utilities/Scripts/ModuleWizard.py”, line 39, in copyAndReplace
contents = fp.read()
File “/usr/lib/python3.10/codecs.py”, 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/ModuleWizard.py --template ./Extensions/Testing/ScriptedLoadableExtensionTemplate --target …/ModuleName ModuleName

but this gave the following error:

File “./Utilities/Scripts/ModuleWizard.py”, 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