Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
15579738
Commit
15579738
authored
Dec 06, 2003
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Incorporate suggestions from Aahz.
parent
ec8f71b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
Doc/tut/tut.tex
Doc/tut/tut.tex
+9
-7
No files found.
Doc/tut/tut.tex
View file @
15579738
...
...
@@ -2,9 +2,6 @@
\usepackage
[T1]
{
fontenc
}
% 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
\title
{
Python Tutorial
}
...
...
@@ -4397,7 +4394,7 @@ operating system:
\begin
{
verbatim
}
>>> import os
>>> os.system
(
'
copy
/
data
/
mydata.fil
/
backup
/
mydata.fil
'
)
>>> os.system
(
'
time
0
:
02
'
)
0
>>> os.getcwd
()
# Return the current working directory
'C:
\\
Python
24
'
...
...
@@ -4484,9 +4481,7 @@ The most direct way to terminate a script is to use \samp{sys.exit()}.
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,
For complex matching and manipulation, regular expressions offer succinct,
optimized solutions:
\begin
{
verbatim
}
...
...
@@ -4497,6 +4492,13 @@ optimized solutions:
'cat in the hat'
\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
}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment