If you want to run the Nmap command using the command line, you can easily get the command line equivalent of the nmScan.scan('127.0.0.1', '22-443') line of code, by using the command_line() method, which reads the scan method call and generate an equivalent command for running on command line.