Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def my_mp4_playlist(file_path, new_song):
- open_file = open(file_path, "r")
- text = open_file.read()
- list = text.split("\n")
- open_file.close()
- change_text = open(file_path, "w")
- length = len(list)
- count = 0
- if length >= 3:
- for letter in list[2]:
- if letter == ";":
- break
- count += 1
- list[2] = new_song + list[2][count::]
- string = "\n".join(list)
- change_text.write(string)
- change_text.close()
- print(string)
- else:
- i = length
- while i < 3:
- list.append("")
- i += 1
- for letter in list[2]:
- if letter == ";":
- break
- count += 1
- list[2] = new_song + list[2][count::]
- string = "\n".join(list)
- change_text.write(string)
- change_text.close()
- print(string)
- my_mp4_playlist(r"C:\New folder\a.txt", "gay")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement