I'm new to python and I'm trying to make a search bar that searches only 2 directories using two find commands and output the results into an ordered list [].
def search_entry(self, widget,):
s1 = subprocess.Popen(['find /home/bludiescript/tv-shows', '-type f'], shell=False, stdout=subprocess.PIPE)
s2 = subprocess.Popen(['find /media/FreeAgent\ GoFlex\ Drive/tobins-media', '-type f'], stdin=s1.stdout, shell=False, stdout=subprocess.PIPE)
s1.stdout.close()
self.contents = "\n".join(self.list)
s2.communicate(self.contents)
My search bar:
self.search = gtk.Entry()
self.search.connect("activate", self.search_entry,)
self.box1.pack_start(self.search, True, True, 0)
self.search.show()
errormsg:
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1228, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory