
import sys
import eppformat as epp

if __name__ == "__main__":
    if (len(sys.argv) > 1):
        p = epp.epp_file.parse_stream(open(sys.argv[1], "rb"))
        print("signature =", p.signature)
        print("version =", p.version)
        print(p.header)
        if (len(sys.argv) > 2):
            limit=int(sys.argv[2])
        else:
            limit=None
        for v in p.data[:limit]:
            print(v)
    else:
        print("usage: eppread <file> [limit]")
        sys.exit(1);


from __future__ import print_function

import sys
import eppformat as epp

if __name__ == "__main__":
    if (len(sys.argv) > 1):
        p = epp.epp_file.parse_stream(open(sys.argv[1], "rb"))
        print("signature =", p.signature)
        print("version =", p.version)
        print(p.header)
        if (len(sys.argv) > 2):
            limit=int(sys.argv[2])
        else:
            limit=None
        for v in p.data[:limit]:
            print(v)
    else:
        print("usage: eppread <file> [limit]")
        sys.exit(1);

Improve printing of signature and version
Improve printing of signature and version

+ 
+ from __future__ import print_function
  
  import sys
  import eppformat as epp
  
  if __name__ == "__main__":
      if (len(sys.argv) > 1):
          p = epp.epp_file.parse_stream(open(sys.argv[1], "rb"))
          print("signature =", p.signature)
          print("version =", p.version)
          print(p.header)
          if (len(sys.argv) > 2):
              limit=int(sys.argv[2])
          else:
              limit=None
          for v in p.data[:limit]:
              print(v)
      else:
          print("usage: eppread <file> [limit]")
          sys.exit(1);
  
Improve printing of signature and version
## Code Before:

import sys
import eppformat as epp

if __name__ == "__main__":
    if (len(sys.argv) > 1):
        p = epp.epp_file.parse_stream(open(sys.argv[1], "rb"))
        print("signature =", p.signature)
        print("version =", p.version)
        print(p.header)
        if (len(sys.argv) > 2):
            limit=int(sys.argv[2])
        else:
            limit=None
        for v in p.data[:limit]:
            print(v)
    else:
        print("usage: eppread <file> [limit]")
        sys.exit(1);

## Instruction:
Improve printing of signature and version
## Code After:

from __future__ import print_function

import sys
import eppformat as epp

if __name__ == "__main__":
    if (len(sys.argv) > 1):
        p = epp.epp_file.parse_stream(open(sys.argv[1], "rb"))
        print("signature =", p.signature)
        print("version =", p.version)
        print(p.header)
        if (len(sys.argv) > 2):
            limit=int(sys.argv[2])
        else:
            limit=None
        for v in p.data[:limit]:
            print(v)
    else:
        print("usage: eppread <file> [limit]")
        sys.exit(1);
