summaryrefslogtreecommitdiffstats
path: root/Demo/zlib
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
committerCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
commit6f2df4d5e193d54244b0c2de91ef0ab1604b9243 (patch)
tree5e172400da7561eb4bb8fafc62c8cab511d74dad /Demo/zlib
parenta8c360ee76fb76902a2e2140fbb38d4b06b2d9fb (diff)
downloadcpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.zip
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.gz
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.bz2
Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
Diffstat (limited to 'Demo/zlib')
-rwxr-xr-xDemo/zlib/minigzip.py12
-rwxr-xr-xDemo/zlib/zlibdemo.py14
2 files changed, 13 insertions, 13 deletions
diff --git a/Demo/zlib/minigzip.py b/Demo/zlib/minigzip.py
index 87fed4a..28d8b26 100755
--- a/Demo/zlib/minigzip.py
+++ b/Demo/zlib/minigzip.py
@@ -49,10 +49,10 @@ def compress (filename, input, output):
def decompress (input, output):
magic = input.read(2)
if magic != '\037\213':
- print 'Not a gzipped file'
+ print('Not a gzipped file')
sys.exit(0)
if ord(input.read(1)) != 8:
- print 'Unknown compression method'
+ print('Unknown compression method')
sys.exit(0)
flag = ord(input.read(1))
input.read(4+1+1) # Discard modification time,
@@ -100,14 +100,14 @@ def decompress (input, output):
crc32 = read32(input)
isize = read32(input)
if crc32 != crcval:
- print 'CRC check failed.'
+ print('CRC check failed.')
if isize != length:
- print 'Incorrect length of data produced'
+ print('Incorrect length of data produced')
def main():
if len(sys.argv)!=2:
- print 'Usage: minigzip.py <filename>'
- print ' The file will be compressed or decompressed.'
+ print('Usage: minigzip.py <filename>')
+ print(' The file will be compressed or decompressed.')
sys.exit(0)
filename = sys.argv[1]
diff --git a/Demo/zlib/zlibdemo.py b/Demo/zlib/zlibdemo.py
index b449c19..53463dd 100755
--- a/Demo/zlib/zlibdemo.py
+++ b/Demo/zlib/zlibdemo.py
@@ -11,7 +11,7 @@ def main():
filename = sys.argv[1]
else:
filename = sys.argv[0]
- print 'Reading', filename
+ print('Reading', filename)
f = open(filename, 'rb') # Get the data to compress
s = f.read()
@@ -21,9 +21,9 @@ def main():
comptext = zlib.compress(s, 1)
decomp = zlib.decompress(comptext)
- print '1-step compression: (level 1)'
- print ' Original:', len(s), 'Compressed:', len(comptext),
- print 'Uncompressed:', len(decomp)
+ print('1-step compression: (level 1)')
+ print(' Original:', len(s), 'Compressed:', len(comptext), end=' ')
+ print('Uncompressed:', len(decomp))
# Now, let's compress the string in stages; set chunk to work in smaller steps
@@ -40,9 +40,9 @@ def main():
decomp = decomp + decompressor.decompress(comptext[i:i+chunk])
decomp=decomp+decompressor.flush()
- print 'Progressive compression (level 9):'
- print ' Original:', len(s), 'Compressed:', len(comptext),
- print 'Uncompressed:', len(decomp)
+ print('Progressive compression (level 9):')
+ print(' Original:', len(s), 'Compressed:', len(comptext), end=' ')
+ print('Uncompressed:', len(decomp))
if __name__ == '__main__':
main()