python split a string at / code example
Example 1: split string python
file='/home/folder/subfolder/my_file.txt'
file_name=file.split('/')[-1].split('.')[0]
Example 2: how to split word in python
text= "I am Batman"
splitted_text= text.split()
Print(splitted_text)