Найти - Пользователи
Полная версия: python 2 hex: L в конце
Начало » Python для новичков » python 2 hex: L в конце
1
icegood
>>> hex(14331).rjust(8, ‘0’)
'000037fb'
>>> hex(14331L).rjust(8, ‘0’)
'00037fbL'
>>>

как лучше всего избавиться от L в общем случае? Отрезать стрингу в конце неохота
py.user.next
>>> '{:08x}'.format(14331L)
'000037fb'
>>>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB