summaryrefslogtreecommitdiff
path: root/graphics/asymptote/GUI/xasyValidator.py
blob: 264e105441d8b584461215b141cf09b5faec7db8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python3

def validateFloat(text):
    try:
        float(text)
        return True
    except ValueError:
        return False


if __name__ == '__main__':
    assert validateFloat('0.5')
    assert not validateFloat('.-')