Aug-07-2017, 11:59 PM
glob.glob(pattern) will return a list of file names matching that pattern. You can use it to check for each of this file but with .txt extension. If it exists - os.path.exists('test99.txt') for example.
If that happens use os.mkdir() to create a directory with a proper name and move the files there - os.rename().
If that happens use os.mkdir() to create a directory with a proper name and move the files there - os.rename().