str_is_number

emlib.misc.str_is_number(s, accept_exp=False, accept_fractions=False)[source]

Returns True if the given string represents a number

Parameters:
  • s (str) – the string to inspect

  • accept_exp – accept exponential notation

  • accept_fractions – accept numbers of the form “3/4”

Returns:

True if s represents a number, False otherwise

Note

fractions should have the form num/den, like 3/4, with no spaces in between