#!/usr/bin/python3 import os # Get user details username = input('Enter username: ') if username == 'Manager': bind_user = 'cn=Manager,dc=exozy,dc=me' else: bind_user = 'uid=' + username + ',ou=People,dc=exozy,dc=me' # Modify user os.system('EDITOR=nano ldapvi --user ' + bind_user)