basic

version capatibility

Supported Ubuntu and Python Versions

[!NOTE|label:references:]

  • NOTE: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.

-UBUNTU 18.04 ( BIONIC )UBUNTU 20.04 ( FOCAL )UBUNTU 22.04 ( JAMMY )

python 2.3

✔

python 2.4

✔

python 2.5

✔

python 2.6

✔

python 2.7

✔

python 3.1

✔

python 3.2

✔

python 3.3

✔

python 3.4

✔

python 3.5

✔

✔

python 3.6

✔

✔

python 3.7

✔

✔

✔

python 3.8

✔

✔

✔

python 3.9

✔

✔

✔

python 3.10

✔

✔

✔

python 3.11

✔

✔

✔

python 3.12

✔

✔

✔

environment

list included modules

$ python -c 'help("modules")'

Please wait a moment while I gather a list of all available modules...

__future__          _warnings           graphlib            runpy
_abc                _weakref            grp                 sched
_aix_support        _weakrefset         gzip                secrets
...

list lib paths

$ python -c 'import sys; print (sys.path)'
['', '/usr/lib/python39.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']

to Binary

  • octal to binary

    >>> bin( int('0o10', 8) )
    '0b1000'
    >>> bin( int('0o17', 8) )
    '0b1111'
  • decimal to binary

    >>> bin(2)
    '0b10'
    >>> bin(10)
    '0b1010'
    • or

      >>> format( 3, 'b' )
      '11'
      >>> format( 15, 'b' )
      '1111'
  • hexadecimal to binary

>>> bin( int('a', 16) )
'0b1010'
>>> bin( int('f', 16) )
'0b1111'

to Octal

  • binary to octal

    >>> oct( int(str(111), 2) )
    '0o7'
    >>> oct( int(str(1000), 2) )
    '0o10'
  • decimal to octal

    >>> oct(8)
    '0o10'
    • or

      >>> format( 15, 'o' )
      '17'
      >>> format( 8, 'o' )
      '10'
  • hexadecimal to octal

    >>> oct( 0xf )
    '0o17'

to Decimal

  • binary to decimal

    >>> int( str(11), 2 )
    3
    >>> int( str(1010), 2 )
    10
  • octal to decimal

    >>> 0o10
    8
    >>> int( 0o10 )
    8
    >>> int ( str(10), 8 )
    8
  • hexadecimal to decimal

    >>> int( 0xf )
    15

to Hexadecimal

  • binary to hexadecimal

    >>> hex( int(str(1010), 2) )
    '0xa'
    >>> hex( int(str(1111), 2) )
    '0xf'
  • octal to hexadecimal

    >>> hex(0o10)
    '0x8'
    >>> hex( int('0o17', 8 ))
    '0xf'
  • decimal to hexadecimal

    >>> hex(15)
    '0xf'
    >>> hex(66)
    '0x42'
    • or

      >>> format( 15, 'x' )
      'f'
    • or

      >>> '%x' % 15
      'f'

[!NOTE|label:references:]

Last updated