glob and curly brackets

RunLevelZero Aiwass333 at gmail.com
Fri Apr 7 11:23:48 EDT 2006


You just need to literlize them with a forward slash.

" globber = '/home/zhomer/test/{dir1*,dir2*}/{subdir1,subdir2}'
globlist = glob.glob(globber) "

globber = '/home/zhomer/test/\{dir1*,dir2*\}/\{subdir1,subdir2\}'
globlist = glob.glob(globber) 

See if that works for you.




More information about the Python-list mailing list