[Python-checkins] python/dist/src/Doc/tut tut.tex,1.218,1.219
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Sat Dec 6 15:12:02 EST 2003
Update of /cvsroot/python/python/dist/src/Doc/tut
In directory sc8-pr-cvs1:/tmp/cvs-serv3079
Modified Files:
tut.tex
Log Message:
Incorporate suggestions from Aahz.
Index: tut.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v
retrieving revision 1.218
retrieving revision 1.219
diff -C2 -d -r1.218 -r1.219
*** tut.tex 5 Dec 2003 07:53:50 -0000 1.218
--- tut.tex 6 Dec 2003 20:12:00 -0000 1.219
***************
*** 3,9 ****
% Things to do:
- % Add a section on file I/O
- % Write a chapter entitled ``Some Useful Modules''
- % --re, math+cmath
% Should really move the Python startup file info to an appendix
--- 3,6 ----
***************
*** 4398,4402 ****
\begin{verbatim}
>>> import os
! >>> os.system('copy /data/mydata.fil /backup/mydata.fil')
0
>>> os.getcwd() # Return the current working directory
--- 4395,4399 ----
\begin{verbatim}
>>> import os
! >>> os.system('time 0:02')
0
>>> os.getcwd() # Return the current working directory
***************
*** 4485,4491 ****
The \ulink{\module{re}}{../lib/module-re.html}
module provides regular expression tools for advanced string processing.
! When only simple capabilities are needed, string methods are preferred
! because they are easier to read and debug. However, for more
! sophisticated applications, regular expressions can provide succinct,
optimized solutions:
--- 4482,4486 ----
The \ulink{\module{re}}{../lib/module-re.html}
module provides regular expression tools for advanced string processing.
! For complex matching and manipulation, regular expressions offer succinct,
optimized solutions:
***************
*** 4498,4501 ****
--- 4493,4503 ----
\end{verbatim}
+ When only simple capabilities are needed, string methods are preferred
+ because they are easier to read and debug:
+
+ \begin{verbatim}
+ >>> 'tea for too'.replace('too', 'two')
+ 'tea for two'
+ \end{verbatim}
\section{Mathematics\label{mathematics}}
More information about the Python-checkins
mailing list