/[escript]/trunk/doc/cookbook/example01.tex
ViewVC logotype

Diff of /trunk/doc/cookbook/example01.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2960 by artak, Tue Mar 2 06:27:17 2010 UTC revision 2961 by jfenwick, Wed Mar 3 00:56:59 2010 UTC
# Line 475  while a sub-folder of \verb data  called Line 475  while a sub-folder of \verb data  called
475  \begin{verbatim}  \begin{verbatim}
476  save_path = os.path.join("data","example01")  save_path = os.path.join("data","example01")
477  \end{verbatim}  \end{verbatim}
478  The second argument of \verb join \xspace contains a string which is the file name or subdirectory name. We can use the operator \verb|%| to increment our file names with the value \verb|i| denoting a incrementing counter. The sub-string \verb %03d  does this by defining the following parameters;  The second argument of \verb join \xspace contains a string which is the file name or subdirectory name. We can use the operator \verb|%| to use the value of \verb|i| as part of our filename. The sub-string \verb %03d  indicates that we want to substitude a value into the name;
479  \begin{itemize}  \begin{itemize}
480   \item \verb 0  becomes the padding number;   \item \verb 0  means that small numbers should have leading zeroes;
481   \item \verb 3  tells us the amount of padding numbers that are required; and   \item \verb 3  means that numbers should be written using at least 3 digits; and
482   \item \verb d  indicates the end of the \verb %  operator.   \item \verb d  means that the value to substitute will be an integer.
483  \end{itemize}  \end{itemize}
484  To increment the file name a \verb %i  is required directly after the operation the string is involved in. When correctly implemented the output files from this command would be place in the directory defined by \verb save_path  as;  To actually substitute the value of \verb|i| into the name write \verb %i after the string.
485    When done correctly, the output files from this command would be place in the directory defined by \verb save_path  as;
486  \begin{verbatim}  \begin{verbatim}
487  blockspyplot.png  blockspyplot001.png
488  blockspyplot.png  blockspyplot002.png
489  blockspyplot.png  blockspyplot003.png
490  ...  ...
491  \end{verbatim}  \end{verbatim}
492  and so on.  and so on.

Legend:
Removed from v.2960  
changed lines
  Added in v.2961

  ViewVC Help
Powered by ViewVC 1.1.26