From: Noel O'B. <bao...@gm...> - 2009-11-30 15:29:17
|
2009/11/30 Xaver Wurzenberger <xav...@we...>: > Hi guys, > > I've got a few questions about using cclib. Actually, Noel asked me to cc them > here, but I thought it might make sense to generally discuss them here. I > hope they're not too much "newbie-questions", because I'm not really advanced > in programming and python. > > -In which case is the variable 'scfvalues' (not) created? > I tried to get it with a couple of gaussian03 log files, but it was never > existant. If the values are present, they will be parsed, so this may be a bug. > -When is cclib closing its input file? > From my understanding of the source code, that should be done after > parsing (?! logparser.py/line 145 in current stable), but it seems the files > are still open when testing it in a > python console. Just wondering if I have to do anything to cleanly have all > files closed at the end of my code. How did you test that the file is still open? > - Can I trick cclib into reading a string instead of a file? Noel pointed me > to StringIO objects. However, StringIO > simulates an "opened file" while cclib needs a non-open file, right?: >>>> mimicfile=StringIO.StringIO(" Entering Gaussian System, Link > 0=/opt/g03/g03/g03\n SCF Done: E(UB+HF-LYP) = -887.172106755 A.U. after > 59 cycles") >>>> myfile = cclib.parser.Gaussian("mimicfile") You passed the string mimicfile - you should pass the variable, e.g. Gaussian(mimicfile). However, cclib has been written to parse entire files, not portions of files, so this example may not work. > > Thanks in advance, > Xaver W. > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > cclib-devel mailing list > ccl...@li... > https://lists.sourceforge.net/lists/listinfo/cclib-devel > |