I recall reading, in the Python 3.5 docs, how to change the >>>
on the Python interactive prompt, such as how calling help()
will change it to help>
.
But for some reason, when I've gone back to try and remember, I just can't find the instructions to it. Does anyone know if this is possible?
Go to File -> New Window (Ctrl+N) and a window where you can write your program will pop up.
The Python interactive console (also called the Python interpreter or Python shell) provides programmers with a quick way to execute commands and try out or test code without creating a file.
There are two modes through which we can create and run Python scripts: interactive mode and script mode. The interactive mode involves running your codes directly on the Python shell which can be accessed from the terminal of the operating system.
You remember correctly.
It's in the sys module (sys.ps1 & sys.ps2):
Strings specifying the primary and secondary prompt of the interpreter. These are only defined if the interpreter is in interactive mode. Their initial values in this case are '>>> ' and '... '. If a non-string object is assigned to either variable, its str() is re-evaluated each time the interpreter prepares to read a new interactive command; this can be used to implement a dynamic prompt.
For example:
>>> import sys >>> sys.ps1 = "3.5>>> " 3.5>>> sys.ps2 = "3.5... " 3.5>>>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With