
I re-did the code for Python 2.6, feel free to do whatever you want with it.
- Code: Select all
import os, subprocess
while True:
current = os.getcwd()
print ''
command = raw_input(current + '>')
if command.upper() == 'EXIT':
break
if command.find('cd') != -1:
command = command.replace('cd ', '')
os.chdir(command)
else:
data = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE).communicate()
data = data[0]
print data
Compared to your original program, I think this is a much better approach to things, especially since os.system is obsolete; use subprocess.Popen() instead, happy programming
