2020-02-07 22:17:19

Guys, i want to build a jump to file function, i will walk over it within using os module, it returns a list but, i don't know how to bounce over in a group of files.

i mean let's say it will list my mp3 files in my music foulder, will list the files, im gunna input a song name and it finds simllar files to it since User can't know the exact name of the file.

2020-02-08 02:13:24

It really depends.
If you want a song to start with the provided name, a simple startswith function on any file name should do it. If you want the data to be matched in a string regardless of where it is, a simple in test will help you with that. Alternatively, you can look up regular expressions to control your pattern more precisely.

2020-02-08 13:41:04 (edited by Turkce_Rap 2020-02-08 13:42:09)

amerikranian wrote:

It really depends.
If you want a song to start with the provided name, a simple startswith function on any file name should do it. If you want the data to be matched in a string regardless of where it is, a simple in test will help you with that. Alternatively, you can look up regular expressions to control your pattern more precisely.



You know when yuou press "J" key while you're on winump, you try to find a song within typing, then closest results appear in  a list box, got it?

2020-02-08 16:29:27

Right. A simple string.startswith(message) should do the trick then.