I'm porting some code from Perl to Python, and one of the functions I am moving does the following:
sub _Run($verbose, $cmd, $other_stuff...)
{
...
}
sub Run
{
_Run(1, @_);
}
sub RunSilent
{
_Run(0, @_);
}
so to do it Python, I naively thought I could do the following:
def _Run(verbose, cmd, other_stuff...)
...
def Run(*args)
return _Run(True, args);
def RunSilent
return _Run(False, args);
but that doesn't work, because args is passed as an array/tuple. To make it work, I did the following:
def _Run(verbose, cmd, other_stuff...)
...
def Run(*args)
return _Run(True, ','.join(args));
def RunSilent
return _Run(False, ','.join(args));
but that looks kind of ugly. Is there a better way?