View Single Post
Old Jun 28th, 2005, 6:38 PM   #1
SaturN
Programmer
 
Join Date: Apr 2005
Location: Uk
Posts: 68
Rep Power: 4 SaturN is on a distinguished road
Wink Arranging Music.. :)

Ok another sad useless pointless program! You can tell i get bored...
Bassically it will search the given directories for mp3's and wma's, and then just write them to a html file, with a link so they can be played at the click of a buton, ideal when your music files are all over the shot, like mine are, that's the reason i made it.
So go ahead and take the piss but it has a purpose for me, and it might for someone else!! And if it don't, oh well...
Also, i aint great at html, so it's REALLY basic!! but still works!!

import os
path = "#path to store html doc\music_dir.html"
html = open(path, 'w')
html.write("""
<HTML>
<HEAD>
<TITLE>Entire Music Collection</TITLE>
</HEAD>
<BODY align="center">
<HR>
<H1 align="center">Music Libary</H1>
<HR>
<P align="center">All Songs Are Accesable By Clicking On Them</P>
""")
paths = []
while(1):
	paths.append(raw_input("Path Name: "))
	b = raw_input("Enter Another Path? (Y/N) ")
	if b.lower() == "y":
		b = "y"
	else:
		break
for a in range(len(paths)):
	path = paths[a]
for root, dirs, files in os.walk(path, topdown=False):
	for name in files:
		if os.path.join(root, name).endswith(".wma") or os.path.join(root, name).endswith(".mp3"):
			item1 = os.path.join(root, name)
			item2 = os.path.join(name)
			item = '<P align="center"><A href="',item1,'">',item2,"</A></P>"
			item = "".join(item)
			item = str(item)
			html.write(item)
html.write("""
<P>Thanks For Using Saturn Music Collector</P>
</BODY>
</HTML>
""")
html.close()

Ok, at the moment you have to manually type path name, i've edited this version, the one i used i had the paths stored, I know of a gui directory selector, BUT i don't know how to use it.. i know you need tkinter, which i d/l and installed, but don't have a clue how to use it...
__________________
while me is alive:
	make(life,simple)
SaturN is offline   Reply With Quote