Good morning (all night): whale2: Since I started writing Python in a file, I'm touching an interpreter I've never used.
Start the interpreter
$ python
Python 3.5.1 |Anaconda 4.1.0 (x86_64)| (default, Jun 15 2016, 16:14:02)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Super easy operation
>>> a = (
... 2,3,5,7
... )
>>> print(a)
(2, 3, 5, 7)
>>> exit()
The Python interpreter prompt string is obtained from the sys
module.
Prompt string confirmation
>>> import sys
>>> sys.ps1
'>>> '
>>> sys.ps2
'... '
>>> exit()
It turns out that the interpreter's primary prompt (PS1) is " >>> "
and the secondary prompt (PS2) is " ... "
.
Try changing the prompt
>>> import sys
>>> sys.ps2 = '(๑•̀ㅂ•́)و '
>>> sys.ps1 = '(๑˃̵ᴗ˂̵)و '
(๑˃̵ᴗ˂̵)و '''
(๑•̀ㅂ•́)و interpreter
(๑•̀ㅂ•́)و Women's power
(๑•̀ㅂ•́)و Got up!
(๑•̀ㅂ•́)و '''
'\n Interpreter\n Women's power\n went up!\n'
(๑˃̵ᴗ˂̵)و exit()
(๑˃̵ᴗ˂̵)و✧
Recommended Posts