Не получается вывести из файла названия групп до / и что бы не повторялись :(.
Только получилось записать
f = open ('outpt.txt','wr')
result = commands.getoutput('urpmq -g --list')
f.write(result)
Video/2mandvd
Graphical desktop/Other/3ddesktop
File tools/3dfb
Games/Boards/4stAttack
System/Base/9base
Sound/APE
Education/ATutor
Graphical desktop/Other/AfterStep
Games/Arcade/AlephOne
Development/Python/Base18
Emulators/BasiliskII
Games/Arcade/BlockOutII
Games/Arcade/BomberInstinct
Development/C/C
Graphics/CImg
Development/C/CImg-devel
Publishing/CJK
Publishing/CJK-emacs
Games/Arcade/CriticalMass