Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Holland Computing Center
chipathlon
Commits
805629b3
Commit
805629b3
authored
Mar 17, 2016
by
Adam Caprez
Browse files
Add util function to check numeric type
parent
107edb5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
chipathlon/utils.py
View file @
805629b3
...
...
@@ -47,4 +47,17 @@ def downloadFile(url, localpath, urltype="ftp://", retries=3, overwrite=True, ch
else
:
print
"File already exists, skipping download.
\n
"
return
# http://pythoncentral.io/how-to-check-if-a-string-is-a-number-in-python-including-unicode/
def
is_number
(
s
):
try
:
float
(
s
)
return
True
except
ValueError
:
pass
try
:
import
unicodedata
unicodedata
.
numeric
(
s
)
return
True
except
(
TypeError
,
ValueError
):
pass
return
False
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment