Re: Omitting results with id3reader [Beginner]

2007-12-05 Thread Ionis
Thank you for your help, it is really appreciated. I'll post back if
there are any more problems.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Omitting results with id3reader [Beginner]

2007-12-05 Thread Ionis
On Dec 5, 11:59 am, Chris <[EMAIL PROTECTED]> wrote:
> Ok, just noticed you linked the id3reader.  I tested my code and it
> worked fine.

Thanks alot Chris. Could you comment your code so I can see what each
line is doing? I hope that isn't a problem. Still pretty new to python.
-- 
http://mail.python.org/mailman/listinfo/python-list


Omitting results with id3reader [Beginner]

2007-12-05 Thread Ionis
Hey guys, hope you can help me here. I've been playing with python for
about a week or two and I've been reading "A Byte Of Python" to get me
on my feet. I've decided to write a program which will list all ID3
information in a directory of .mp3 files into a .html file.

The python script I'm using for this, along with album art (Example)
are in the same directory as the music. The output I am getting when
it reads these files is "None" so I tried to set up a way to get rid
of these results and move onto the next file.

The omitting I'm attempting is within the If statement half way down
the code, easy to find. Could anyone point me in the right direction
on how to stop these "None" results showing in the result .html file.

Thanks in advance.

==
import os
import id3reader

songartist = str("")
songtrack = str("")
html_bulkadd = str("")
html_start = str("""

http://www.w3.org/1999/xhtml";>


Test Document


""")
html_end = str("""


""")

output = file("output.html", "w")
output.write("")
output.write(html_start)
output.close

path = ""
dirList = os.listdir(path)
for fname in dirList:
songartist = str("")
songtrack = str("")
id3r = id3reader.Reader(fname)
if id3r.getValue('performer') == "None":
break
elif id3r.getValue('title') == "None":
break
else:
songartist = id3r.getValue('performer')
songtrack = id3r.getValue('title')
output = file("output.html", "a")
output.write("" + str(songartist) + " - " + str(songtrack)
+ "\n")
output.close

output = file("output.html", "a")
output.write("\n"+html_end)
output.close
==

If anyone is curious on the module you can find it here:
http://nedbatchelder.com/code/modules/id3reader.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Opening/Running files through python

2008-01-17 Thread Ionis
Hey guys, hope you can help me here.

I am running in windows and I am trying to open a file via python. I
want the file (a text file) to open up in the users default text
editor. I'm not wanting to read a file, I just want to open it. Is
there a way?

Thanks in advance.
-- 
http://mail.python.org/mailman/listinfo/python-list