dhp.VI package¶
Module contents¶
collection of routines to support python 2&3 code in this package
-
dhp.VI.
iteritems
(dct)¶ return the appropriate method
-
dhp.VI.
py_ver
()¶ return the Major python version, 2 or 3
-
dhp.VI.
set_output_encoding
(encoding=u'utf-8')¶ If Python has punted on output encoding, give it a nudge. (def utf-8)
Python knows the encoding needed when piping to the terminal and automatically sets it. However, when piping to another program (i.e. | less), it is None. Which means it defaults to ascii.
-
dhp.VI.
to_unicode
(obj, encoding=u'utf-8')¶ Convert to unicode if possible.
Parameters: - obj (obj) – object to attempt conversion of
- encoding (str) – default: utf-8
Returns: (unicode|obj)