You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
445 B

  1. #! /usr/bin/env python
  2. import sys
  3. def remove_spaces(array):
  4. return [x for x in array if x != '']
  5. def string_to_array(string, char=' '):
  6. return string.split(char)
  7. def get_encoding():
  8. if sys.version_info >= (3, 0):
  9. return None
  10. if sys.platform == 'win32':
  11. return sys.getfilesystemencoding()
  12. else:
  13. return None
  14. def encode_list(data_list, encoding):
  15. return [x.encode(encoding, 'ignore') for x in data_list]