To make it more robust, some assumptions are made:
1.When using iloc with array slicing.
Here,assuming my_df.columns.is_unique evaluates to True and columns are already in order
start = df.columns.get_loc(con_start())
stop = df.columns.get_loc(con_stop())
df.iloc[:, start:stop + 1]
2.When using loc with boolean slicing.
Assuming that column values are comparable
start = con_start()
stop = con_stop()
c = df.columns.values
m = (start <= c) & (stop >= c)
df.loc[:, m]
If you want to learn Pandas visit this Python Pandas Tutorial.