Re: read input for cmd.Cmd from file

2005-06-03 Thread Peter Otten
Achim Domma (Procoders) wrote: > I'm writing a simple shell using cmd.Cmd. It would be very usefull if I > could read the commands as batchjob from a file. I've tried the following: [...] Your original approach should work too if you clear the use_rawinput flag and provide a do_EOF() method that

Re: read input for cmd.Cmd from file

2005-06-03 Thread Peter Otten
Achim Domma (Procoders) wrote: > I'm writing a simple shell using cmd.Cmd. It would be very usefull if I > could read the commands as batchjob from a file. I've tried the following: > > class MyShell(cmd.Cmd): > def __init__(self,stdin): > cmd.Cmd.__init__(self,stdin=stdin) >

read input for cmd.Cmd from file

2005-06-03 Thread Achim Domma (Procoders)
Hi, I'm writing a simple shell using cmd.Cmd. It would be very usefull if I could read the commands as batchjob from a file. I've tried the following: class MyShell(cmd.Cmd): def __init__(self,stdin): cmd.Cmd.__init__(self,stdin=stdin) ... ... if __name__=='__main__'