Working with python 2.7 And YES, this is my first question to the most intimidating forum I have ever seen. First off, I am not a programmer, but I am trying to learn.
I want to be able to search through a very large dir of mp3's and tell me if what I type in is there and to display it on screen. that's it! Details: I am very new to programming and need much detail. I am willing to learn this on my own, need to know where to look for answer.I have been looking around on here, Google and other places but no info on my project exactly.
This is my code: sorry for putting it all up, I'm new and need to understand.
from sys import argv
from os import walk
import os
prompt = ':)'
print ("Can I help you with anything today?")
filename = raw_input(prompt)
print ("Looking for %r .... This might take a sec.") % filename
#This is where i get stumped, should I use this or something else?
#don't know how to put userinput into search
for dirname, dirnames, filenames in os.walk('.'):
# print path to all subdirectories first.
for subdirname in dirnames:
print os.path.join(dirname, subdirname)
# print path to all filenames.
for filename in filenames:
print os.path.join(dirname, filename)
print (" That's all i got")
print ("Hit ENTER to exit")
raw_input(prompt)
Running this will display a list of all files. I need, For EG: raw_input(prompt) = Tina Turner. I want program to look for all files with the name 'Tina Turner' and display them. babysteps please, should I use walk or find_all or...I'm already going nuts trying to figure this out on my own. Looking for documentation on something I don't understand, or don't know what I'm looking for, is very confusing. I am a noob so pointing me in the correct direction is greatly appreciated. Hope I didn't "P" any 1 off with this life story of an explanation. If i don't read anything in a couple of day's, I'll know why.