Jump to content


Photo

Ch7 - Glob Error?


  • Please log in to reply
1 reply to this topic

#1 tvromero

tvromero

    New Member

  • Members
  • Pip
  • 2 posts

Posted 16 May 2011 - 09:46 PM

I have taken a fully working version of the webapp in Chapter 7 on my local machine and put it out into the wild (www.romero-family.com/webapp) to see if it works.

I had to make some changes to the directories in yate.py (add ../) module to get it going. I seem to be having trouble reading from the data folder in the generate_list.py code.

import glob

#These two lines provide error information on the web screen
import cgitb
cgitb.enable()

data_files = glob.glob("../data/*.txt")
athletes = athletemodel.put_to_store(data_files)

print(yate.start_response())
print(yate.include_header("Coach Kelly's List of Athletes"))
print(yate.start_form("generate_timing_data.py"))

print(yate.para(str(data_files)))

print(yate.para("Select an athlete from the list to work with:"))

I inserted the printing of data_files and as shown on the web it seems to be empty.

Is there something else here that needs to be changed.

Thanks,
Tim

#2 tvromero

tvromero

    New Member

  • Members
  • Pip
  • 2 posts

Posted 16 May 2011 - 09:54 PM

Is there something else here that needs to be changed.


Not sure what changed but I messed around with the *.txt line and just made it * and now it is reading the data correctly. I then went back to the original ../data/*.txt and it is working fine....weird




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users