判定正負数


#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright [Gtlions Lai].
# Create Date:
# Update Date:
__authors__ = '"Gtlions Lai" '

"""     .

      .

  ClassFoo:    .
  functionBar():     .
"""
import re
import string


num = '^[-+]{0,1}[0-9]{1,}.{0,1}[0-9]{0,}'
check = True
while check:
    input = raw_input("       :")
    if len(input) == 0 or not re.findall(num,input):
        print "    !"
        break
    inputnew = string.atof(input)
    if inputnew > 0 or inputnew < 0:
        if inputnew > 0:
            print input , "   !"
        if inputnew < 0:
            print input , "   !"
    else:
        print "    0,          !"


-EOF-