2010-12-08, 22:45
i have been playing around with part of your code outside of xbmc. just trying to get a feel for how Popen works... its almost like its going to fast to grab the variables or something..
here's the code i was playing with. just does a list of all roms in mame directory then takes it through a loop to try to get the rom full names..
Have not gotten it to work properly.
here's the code i was playing with. just does a list of all roms in mame directory then takes it through a loop to try to get the rom full names..
Have not gotten it to work properly.
Quote:import os
import re
import subprocess
lsprocess=subprocess.Popen('ls -1 /home/john/.mame/roms/',shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
filenames=lsprocess.stdout.read()
filename=re.findall('(.+?).zip',filenames)
for index1 in range(len(filename)):
file=filename[index1]
file=file.strip()
file='/usr/games/mame','-listxml '
process = subprocess.Popen(file)
name= process.stdout.read()
print 'return code:'+ name
name2=re.findall('<description>(.+?)</description>',name)
print name2