Create new segment in Python script