def getMininetVersion(vm):
 vm.sendline('~/mininet/bin/mn --version')
 vm.readline()
 version = vm.readline().strip()
 return version

def getMininetVersion ( vm ) : vm . sendline ( '~/mininet/bin/mn --version' ) vm . readline ( ) version = vm . readline ( ) . strip ( ) return version
run mn to find mininet version in vm .