socket$ python3.4
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print() >>> s='1a'
>>> l=[12]
>>> print(s, l)
1a [12]
>>> print(s, l, sep='')
1a[12]
>>> print(s, l, sep=',')
1a,[12]
>>> print(s, l, sep=',',end='')
1a,[12]>>>
>>> print(s, l, sep=',',end='\n')
1a,[12]
>>>
Help on built-in function print in module builtins:
>>> print(s, l, sep=',', file=open('t.txt', 'w'))
>>> with open(t.txt) as f: >>> f = open('t.txt')
>>> f
<_io.TextIOWrapper name='t.txt' mode='r' encoding='UTF-8'>
>>> f.readlines()
['1a,[12]\n']
>>>
print(...)
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments:
file: a file-like object (stream); defaults to the current sys.stdout.
sep: string inserted between values, default a space.
end: string appended after the last value, default a newline.
flush: whether to forcibly flush the stream.
(END)
|