Commit 84ca9f79 by 岳巧源

add function

parent 5415c30e
Showing with 18 additions and 0 deletions
...@@ -5,6 +5,24 @@ import pika ...@@ -5,6 +5,24 @@ import pika
import requests import requests
def is_number(s):
"""check if the input is number"""
if s.lower() == "nan":
return False
try:
float(s)
return True
except ValueError:
pass
try:
import unicodedata
unicodedata.numeric(s)
return True
except (TypeError, ValueError):
pass
return False
class Producer: class Producer:
"""init rabbitmq connection and push message""" """init rabbitmq connection and push message"""
def __init__(self, config: dict): def __init__(self, config: dict):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment