Return the command response.
()
| 54 | TOFILE.flush() |
| 55 | |
| 56 | def get_response(): |
| 57 | """Return the command response.""" |
| 58 | result = '' |
| 59 | line = '' |
| 60 | while True: |
| 61 | result += line |
| 62 | line = FROMFILE.readline() |
| 63 | if line == '\n' and len(result) > 0: |
| 64 | break |
| 65 | return result |
| 66 | |
| 67 | def do_command(command): |
| 68 | """Send one command, and return the response.""" |