Substring Till A Character In Python