Usually the Python console looks like this:
>>> command
Is there a way to make it look like:
SomeText>>> command
Usually the Python console looks like this:
>>> command
Is there a way to make it look like:
SomeText>>> command
sys.ps1 == ">>>"
sys.ps2 == "..."
You can also change this in the PYTHONSTARTUP environment variable.
For example (this is not secure), put the following in a script somewhere and set PYTHONSTARTUP to point at that script.
import sys
import getpass
sys.ps1 = getpass.getuser( ) + ">>> "
Of course, you could change the last line above to anything you want.
You could try
import sys
import os
sys.ps1 = os.getenv("USER") + sys.ps1
(or getpass.getuser()
as suggested by the other answer)
In the corrected version, it's even easier, of course:
import sys
sys.ps1 = "SomeText" + sys.ps1