Mercurial > hg > webcalc
comparison webcalc/webcalc.py @ 1:12ac99c240ca default tip
* add documentation
* add 1..10 autostep feature
* bump version
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Wed, 10 Mar 2010 17:48:11 -0500 |
parents | 1eea6356d2e5 |
children |
comparison
equal
deleted
inserted
replaced
0:1eea6356d2e5 | 1:12ac99c240ca |
---|---|
127 value = float(token) | 127 value = float(token) |
128 retval.append(value) | 128 retval.append(value) |
129 continue | 129 continue |
130 except ValueError: | 130 except ValueError: |
131 pass | 131 pass |
132 start, step, end = token.split('..') | 132 count = token.count('..') |
133 assert count in set([1,2]) | |
134 if count == 1: | |
135 start, end = token.split('..') | |
136 step = 1.0 | |
137 else: # count == 2 | |
138 start, step, end = token.split('..') | |
133 start = float(start) | 139 start = float(start) |
134 step = float(step) | 140 step = float(step) |
135 end = float(end) | 141 end = float(end) |
136 | 142 |
137 values = [ start ] | 143 values = [ start ] |