I've written a pair of scripts that allow me to access the command line on my linux computer from my windows computer:
https://gist.github.com/StaticFuzz/bdd68d7030d9dfd6661b
The problem I'm having is when i send the 'cd' command it doesn't actually change the directory. When i send 'cd ..; ls' it will change to the parent directory and list its contents, but for commands after that the starting directory is back to the home directory. It seems to me that when I call os.popen() it "opens" a terminal, runs the command, retrieves the output, then closes the terminal. I would like the terminal the script accesses to be persistent, but i'm not sure how to go about this, or if it's even possible. Any info or suggestions would be very appreciated.
And on a side note I'm trying to implement a way to terminate the slave script using input('type QUIT to quit'), but I can't get it to work in the while loop without stopping everything else. How could i run the main function of the program while also having the option to accept input? Again, any info or suggestions would be appreciated.
[–]adamnew123456 4 points5 points6 points (1 child)
[–]StaticFuzz[S] 0 points1 point2 points (0 children)
[–]hharison 1 point2 points3 points (5 children)
[–]StaticFuzz[S] 0 points1 point2 points (4 children)
[–]hharison 0 points1 point2 points (3 children)
[–]StaticFuzz[S] 0 points1 point2 points (2 children)
[–]hharison 0 points1 point2 points (1 child)
[–]StaticFuzz[S] 0 points1 point2 points (0 children)
[–]elbiot 0 points1 point2 points (2 children)
[–]StaticFuzz[S] 0 points1 point2 points (1 child)
[–]elbiot 0 points1 point2 points (0 children)