Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

paynito

  • 3 years ago

Importing data from excel files via python. I have course syllabli in 4 excel files with 2 columns [date, tue 5/2/2012, fri 5/2/2012, tue 5/9/2012 .. . .] [chapter, 4.1-4.3, 4.4-4.5, 4.6 and ch. 4 test] . . . I want to convert these to weekly lesson plans (#begin pseduo code: converts excel files to weekly lesson plans for 2012-2013 school year; import calendar; open file1:math_4th_grade.csv; csv_to_dictionary(file1); for week40:Nov13-18: get file[1,2,3,4] date_in(week40) -> output to Latex pdf as lesson plan)) Is that going to be more trouble than importing into LibreOffice Base-run report

  • This Question is Closed
  1. paynito
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    http://www.doughellmann.com/PyMOTW/csv/ is the csv module for python, trying that instead of the excel-python API . . .put all4 syllabi into one file, but they are all different additionally since days have changed I want a way to change all Monday classes in column 4th_grade to Tuesdays, incrementing day+1 either in excel or in python would be fine.

  2. paynito
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    This seems like what I'm looking for http://stackoverflow.com/questions/ 8085520/ generating-pdf-latex-with-python-script Take your LaTeX document above and "tokenize" the file by placing %(placeholder_name1)s tokens into the document. For example, where you want your class name to go, use %(course_name)s \textbf{\Large "%(homework_title)s" \\} \vspace{1cm} \textbf{\Large "%(course_name)s" \\} Then, from Python, you can load in that template and format it as: template = file('template.tex', 'r').read() page = template % {'course_name' : 'Computer Science 500', 'homework_title' : 'NP-Complete'} file('result.tex', 'w').write(page)

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy