This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def redis_protocol(cmd): | |
| proto = "*%d\r\n" % len(cmd.split(' ')) | |
| for arg in cmd.split(' '): | |
| proto += "$%d\r\n%s\r\n" % (len(arg), arg) | |
| return proto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| if len(sys.argv) != 3: | |
| print ''' | |
| (!) First argument should be diego_has.txt | |
| (!) Second argument should be diego_needs.txt | |
| Run like this:\n\tpython fifa.py diego_has.txt diego_needs.txt | |
| ''' |