summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-05-15 08:03:03 (GMT)
committerGeorg Brandl <georg@python.org>2009-05-15 08:03:03 (GMT)
commit490096e7605aae03f59881923dacbea266746ad5 (patch)
tree8b1642cf3d88d1ec5abaa332d443e0d6fd68e0c3 /Doc/library
parent0f489743ef18ab2da39695d945c79b7a24df8554 (diff)
downloadcpython-490096e7605aae03f59881923dacbea266746ad5.zip
cpython-490096e7605aae03f59881923dacbea266746ad5.tar.gz
cpython-490096e7605aae03f59881923dacbea266746ad5.tar.bz2
Fix example output for doctest-like demos.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/ctypes.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
index ad9108b..9a1acd6 100644
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -341,9 +341,9 @@ within *IDLE* or *PythonWin*::
>>> printf("Hello, %s\n", "World!")
Hello, World!
14
- >>> printf("Hello, %S", u"World!")
+ >>> printf("Hello, %S\n", u"World!")
Hello, World!
- 13
+ 14
>>> printf("%d bottles of beer\n", 42)
42 bottles of beer
19
@@ -358,7 +358,7 @@ unicode strings have to be wrapped in their corresponding ``ctypes`` type, so
that they can be converted to the required C data type::
>>> printf("An int %d, a double %f\n", 1234, c_double(3.14))
- Integer 1234, double 3.1400001049
+ An int 1234, a double 3.140000
31
>>>
@@ -414,9 +414,9 @@ prototype for a C function), and tries to convert the arguments to valid types::
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ArgumentError: argument 2: exceptions.TypeError: wrong type
- >>> printf("%s %d %f", "X", 2, 3)
- X 2 3.00000012
- 12
+ >>> printf("%s %d %f\n", "X", 2, 3)
+ X 2 3.000000
+ 13
>>>
If you have defined your own classes which you pass to function calls, you have