Mercurial > hg
comparison tests/seq.py @ 28722:2cd8c3b0bd11
py3: use print_function in seq.py
author | Robert Stanca <robert.stanca7@gmail.com> |
---|---|
date | Sat, 02 Apr 2016 17:29:38 +0300 |
parents | ff3be5a325bc |
children | 08b8b56bd2e8 |
comparison
equal
deleted
inserted
replaced
28721:ff3be5a325bc | 28722:2cd8c3b0bd11 |
---|---|
5 # Usage: | 5 # Usage: |
6 # seq STOP [1, STOP] stepping by 1 | 6 # seq STOP [1, STOP] stepping by 1 |
7 # seq START STOP [START, STOP] stepping by 1 | 7 # seq START STOP [START, STOP] stepping by 1 |
8 # seq START STEP STOP [START, STOP] stepping by STEP | 8 # seq START STEP STOP [START, STOP] stepping by STEP |
9 | 9 |
10 from __future__ import absolute_import | 10 from __future__ import absolute_import, print_function |
11 import sys | 11 import sys |
12 | 12 |
13 start = 1 | 13 start = 1 |
14 if len(sys.argv) > 2: | 14 if len(sys.argv) > 2: |
15 start = int(sys.argv[1]) | 15 start = int(sys.argv[1]) |
19 step = int(sys.argv[2]) | 19 step = int(sys.argv[2]) |
20 | 20 |
21 stop = int(sys.argv[-1]) + 1 | 21 stop = int(sys.argv[-1]) + 1 |
22 | 22 |
23 for i in xrange(start, stop, step): | 23 for i in xrange(start, stop, step): |
24 print i | 24 print(i) |