def str_display_width(s):
    '''
        from elist.utils import *
        str_display_width('a')
        str_display_width('去')
    '''
    s= str(s)
    width = 0
    len = s.__len__()
    for i in range(0,len):
        sublen = s[i].encode().__len__()
        sublen = int(sublen/2 + 1/2)
        width = width + sublen
    return(width)
def str_display_width(s):
    '''
        from elist.utils import *
        str_display_width('a')
        str_display_width('去')
    '''
    s= str(s)
    width = 0
    len = s.__len__()
    for i in range(0,len):
        sublen = s[i].encode().__len__()
        sublen = int(sublen/2 + 1/2)
        width = width + sublen
    return(width)
def str_display_width ( s ) : s = str ( s ) width = 0 len = s . __len__ ( ) for i in range ( 0 , len ) : sublen = s [ i ] . encode ( ) . __len__ ( ) sublen = int ( sublen / 2 + 1 / 2 ) width = width + sublen return ( width )
from elist.utils import *
        str_display_width('a')
        str_display_width('去')
from elist . utils import * str_display_width ( a ) str_display_width ( 去 )