Changes between Version 8 and Version 9 of FAQ_WrapperScriptBasics


Ignore:
Timestamp:
Aug 1, 2008 5:46:57 PM (13 years ago)
Author:
dkearney
Comment:

updated python's getCommandOutput reference

Legend:

Unmodified
Added
Removed
Modified
  • FAQ_WrapperScriptBasics

    v8 v9  
    4343|| 2 || Pay attention to all lines that use the "get" function. They are grabbing information from the Rappture library. If you are confused by the path argument (the input.blah stuff) check out our page on [wiki:FAQ_XmlPathNames Reading XML Paths] || '''$opt get input.(structure).(p_node).current''' || '''inputType = lib.get('input.loader.current')''' ||
    4444|| 3 || Look for the appending of information to a variable, and the writing of variables to files || '''append deck ...''' [[BR]] '''set deckfile "pdr[pid]"''' [[BR]] '''set fid [open $deckfile w]''' [[BR]] '''puts $fid $deck '''[[BR]] '''close $fid''' || '''outFileName = 'inputDeck.' + getDriverId(inDeckName)''' [[BR]] '''fh = open(outFileName, 'w')''' [[BR]] '''if fh != None:''' [[BR]] '''fh.write(writeData)''' [[BR]] '''fh.close()''' ||
    45 || 4 || Look for the Rappture::exec call. That is how to execute external programs in Tcl || '''set status [catch {Rappture::exec $program $deckfile} out]''' || '''dirpath = os.path.dirname(sys.argv![0])''' [[BR]] '''getCommandOutput('%s/sineIt.py %s' % (dirpath,outFileName))''' ||
     45|| 4 || Look for the Rappture::exec call. That is how to execute external programs in Tcl || '''set status [catch {Rappture::exec $program $deckfile} out]''' || '''dirpath = os.path.dirname(sys.argv![0])''' [[BR]] '''Rappture.tools.getCommandOutput('%s/sineIt.py %s' % (dirpath,outFileName))''' ||
    4646|| 5 || Generally the code right after the Rappture::exec function call deals with parsing the output || ?? || ?? ||
    4747|| 6 || Anywhere you see the "put" function being used, you know we are trying to put information back into the Rappture library. || '''$opt put output.log $out''' || '''lib.put('output.curve(sin_data).about.label','sin curve')''' ||