Python Console Menu
David Raymond
David.Raymond at tomtom.com
Tue Jul 31 11:15:24 EDT 2018
Take a look at the subprocess module for how to "spawn new processes, connect to their input/output/error pipes, and obtain their return codes."
https://docs.python.org/2/library/subprocess.html
-----Original Message-----
From: Python-list [mailto:python-list-bounces+david.raymond=tomtom.com at python.org] On Behalf Of Tcpip via Python-list
Sent: Tuesday, July 31, 2018 10:56 AM
To: python-list at python.org
Subject: Python Console Menu
Hi all,
Im new with python, im working on a Python console Menu, I found some examples on Git, but what I need to understand is how I can call a subprocess.
Here is an Example ,
if choice==1:
print "Test SSH Connection (check ssh to all hosts)"
## You can add your code or functions here
#print_menu()
elif choice==2:
print "Menu 2 has been selected"
## You can add your code or functions here
elif choice==3:
print "Menu 3 has been selected"
## You can add your code or functions here
elif choice==4:
print "Menu 4 has been selected"
## You can add your code or functions here
elif choice==5:
print "Menu 5 has been selected"
## You can add your code or function here
Thanks.
--
https://mail.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list