How to split train test data using python

i want to generate that test data using python script