Python Code Snippets

List of files, just filenames, no directories.

filenames_no_dirs = next(os.walk(directory))[2]

List files, no directories, full path

filenames = [os.path.join(directory, fn) for fn in next(os.walk(directory))[2]]

Indicate that your string variable is a raw string.

print(r'%s' % raw_string)