I have made a program in python client-server but I can not use the command in cd in shell mode which are the commands I use for msdos. I have been told with threads you can do I have used this:
x = input("introduce el comando: ") subprocess.call([x, ''], shell=True) subprocess.call('cd ..', shell=True)
With a while loop I repeat the sequences and I'm entering the command that I want. but the cd never does it to me.
use a function that simulates the command cd ..
to go back in directory (this will give effect of cd ..)
def back(): path=os.getcwd() print path s=path.split('\') length=len(s) x=0 while x<(length-1): if x==0: back_path=s[x]+"\" else: back_path=back_path+s[x]+"\" x+=1 os.chdir(back_path)
How can I implement in my program?
python the worst language I've seen can not even use the cd .. .....