Search code examples
pythonenthoughtcanopynipype

String format argument for traits.Any


I'm using enthought canopy's traits to wrap a code for Nipype. I know format argument is %d for integer variables. However, Multiplication variable below should be also a file.

multiplication = traits.Int(argstr='-mul %d', desc='multiplication', position=2)

So, I want to use Any instead of Int but I don't know what the corresponding format argument is for Any. How can I replace %? below?

multiplication = traits.Any(argstr='-mul %?', desc='multiplication', position=2)

Solution

  • I've got the answer multiplication = traits.Any(argstr='-mul %s', desc='multiplication', position=2) It works for both integer and file