How can I make the -c switch not require input? and then if the -c switch is specified when running the test.py script it should run this if statement and create the database. I'm not an expert so I would appreciate a code example.
parser = argparse.ArgumentParser(prog='test.py', description='Testing Script')
parser.add_argument('-d', '--device', nargs= '*', type=str, help="Device IP")
parser.add_argument("-c", '--createDatabase', nargs= '?', help="Create Database")
parser = menu.parse_args()
if args.c:
print 'It Worked!, now creating database'
con1 = MySQLdb.connect("localhost","root","testing")
query = con1.cursor()
query.execute("SET sql_notes = 0; ")
query.execute("CREATE DATABASE IF NOT EXISTS test CHARACTER SET utf8 COLLATE utf8_general_ci;")
con1.commit()
con1.close()