<div dir="ltr">I'm not sure this is the right place for your question, but check how you capitalised "filename" - in one case you used "fileName" and then called "print filename" - because it is all lowercase this variable is undefined, can't be printed, and you get an error. You would probably have better luck posting this kind of question on a python support forum (e.g. <a href="http://bytes.com">http://bytes.com</a>).<br>
<br><div class="gmail_quote">On Mon, Jul 21, 2008 at 3:38 PM, suhail shaik <<a href="mailto:suhailsqm@gmail.com">suhailsqm@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">hi ...<br><br>##################<br>#!/usr/bin/python<br>#Globals here<br>ROOTDIR = "/home/qmss2/Desktop/sbd/hive2_ffmpegsvn/" # Root dir where ts files are located (or recorded)<br>PNAME = "/data/test/"<br>
#DAILY_UPLOAD_PATH = "/mmis-ss9952/newsroom/du-dev/"<br><br>import os,glob<br>### MAIN ###<br>os.chdir(ROOTDIR)<br>os.mkdir("kf")<br>os.chdir(PNAME)<br>for fileName in glob.glob('*.mpg'):<br> print filename<br>
<br> file = fileName.split(".")<br> print file<br> os.chdir(ROOTDIR+"/kf")<br> os.mkdir(file)<br> command = "./hive2 -k kf/"+file+"/ -o "+file+".xml /data/test/"+fileName<br>
print command<br> os.system(command)<br><br>#################<br><br>i get the following error...<br><br>File "/home/qmss2/Desktop/sbd/mpg.py", line 13, in <module><br> print filename<br>NameError: name 'filename' is not defined<br>
<br><br>Please suggest me i am trying to read all the .mpg files from a directory..<br><br>thanks in advance ...please urgent help..<br><br><br><br></div>
<br>_______________________________________________<br>
python-uk mailing list<br>
<a href="mailto:python-uk@python.org">python-uk@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-uk" target="_blank">http://mail.python.org/mailman/listinfo/python-uk</a><br>
<br></blockquote></div><br></div>