Learn to talk to computers

Invoking the command line with python

January 28, 2019

cmd2 is a tool for building interactive command line applications in python. It’s main aim is to help developers work fast and efficiently.

Description

cmd2 is a python module and is an extension of Cmd (which is a simple framework for writing line-oriented command interpreters).It’s main feature is autocompletion.

Installation

pip install cmd2

Basics

from cmd2 import Cmd

class Demo(Cmd):
	def __init__(self):
		Cmd.__init__(self)

if __name__ == '__main__':
	app = Demo()
	app.cmdloop()

nightwarriorftw

Written by nightwarriorftw who lives and works in a small town full of Darkness building problem solving stuff. You should follow him on Twitter