mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Convert all print statements in the docs.
This commit is contained in:
parent
c9879246a2
commit
6911e3ce3f
71 changed files with 351 additions and 388 deletions
|
@ -64,7 +64,7 @@ perform some operation on a file. ::
|
|||
{
|
||||
Py_Initialize();
|
||||
PyRun_SimpleString("from time import time,ctime\n"
|
||||
"print 'Today is',ctime(time())\n");
|
||||
"print('Today is', ctime(time()))\n");
|
||||
Py_Finalize();
|
||||
return 0;
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ array. If you compile and link this program (let's call the finished executable
|
|||
:program:`call`), and use it to execute a Python script, such as::
|
||||
|
||||
def multiply(a,b):
|
||||
print "Will compute", a, "times", b
|
||||
print("Will compute", a, "times", b)
|
||||
c = 0
|
||||
for i in range(0, a):
|
||||
c = c + b
|
||||
|
@ -234,7 +234,7 @@ These two lines initialize the ``numargs`` variable, and make the
|
|||
With these extensions, the Python script can do things like ::
|
||||
|
||||
import emb
|
||||
print "Number of arguments", emb.numargs()
|
||||
print("Number of arguments", emb.numargs())
|
||||
|
||||
In a real application, the methods will expose an API of the application to
|
||||
Python.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue