Both Sever and Client contain two file folders called ‘Song’ and ‘Lists’. The folder ‘Song’ is used to hold song file, and in Server there is one more list(songList.txt) which record all the name and id of available song. The folder ‘Lists’ is used to hold the playlist, and in Sever there is also a list(playLists.txt) which contains all the name and id of available playlists. At beginning, the folder ‘Lists’ of Client is empty, and these .mp3 file in folder ‘Song’ of Client means client’s local song. Client can download or upload playlist or song from Server and save it in the folder.
Data format in playlists.txt:
"playlist name"
"SongID", "SongName"
"SongID", "SongName" ……
For example, in 1_playlist.txt:
List A
1,Song A
3,Song C
The other .txt file is of the same format
When Sever reading these files, it will return a Python Dict.
chenstarx / socket-demo-with-gui Goto Github PK
View Code? Open in Web Editor NEWA file transfer python socket demo with GUI