Run commands from file: load cmd.txt
(self, arg)
| 171 | |
| 172 | # ------------------------[ load ]------------------------------------ |
| 173 | def do_load(self, arg): |
| 174 | "Run commands from file: load cmd.txt" |
| 175 | if not arg: |
| 176 | arg = eval(input("File: ")) |
| 177 | data = file().read(arg).decode() or "" |
| 178 | for cmd in data.splitlines(): |
| 179 | # simulate command prompt |
| 180 | print((self.prompt + cmd)) |
| 181 | # execute command with premcd |
| 182 | self.onecmd(self.precmd(cmd)) |
| 183 | |
| 184 | # ------------------------[ loop <cmd> <arg1> <arg2> … ]-------------- |
| 185 | def do_loop(self, arg): |