code: def _swap_columns(self, side):
          
          displayed_cols = self._displayed_cols
          i1 = self._dragged_col_index
          i2 = i1 + 1 if side == 'right' else i1 - 1
          if 0 <= i2 < len(displayed_cols):
              # there is a neighbor, swap columns:
              displayed_cols[i1] = displayed_cols[i2]
              displayed_cols[i2] = self._dragged_col
              self["displaycolumns"] = displayed_cols
              if side == 'left':
                  right = self._dragged_col_neighbor_widths[0]
                  self._dragged_col_x -= right  # update dragged column x coordinate
                  # set new left neighbor width
                  if i2 > 0:
                      left = ttk.Treeview.column(self, displayed_cols[i2 - 1], 'width')
                  else:
                      left = None
              else:
                  left = self._dragged_col_neighbor_widths[1]
                  self._dragged_col_x += left  # update x coordinate of dragged column
                  # set new right neighbor width
                  if i2 < len(displayed_cols) - 1:
                      right = ttk.Treeview.column(self, displayed_cols[i2 + 1], 'width')
                  else:
                      right = None
              self._dragged_col_index = i2  # update dragged column index
              self._dragged_col_neighbor_widths = (left, right)
docs: Swap dragged column with its side (=left/right) neighbor.