Call script from function instead of subprocess call