Change the prompt to show the current dir?

14 views
Skip to first unread message

Sebastián Monía

unread,
Jul 21, 2016, 5:44:40 PM7/21/16
to bpython
Hi,

I was wondering if there's a way to do this. I can get a hold of sys.ps1 from the terminal...

Sebastian Ramacher

unread,
Sep 21, 2016, 8:54:54 AM9/21/16
to bpython
On Thursday, July 21, 2016 at 11:44:40 PM UTC+2, Sebastián Monía wrote:
Hi,

I was wondering if there's a way to do this. I can get a hold of sys.ps1 from the terminal...

I think you'd need to write some code for that to be possible.

Cheers

Andreas Stührk

unread,
Sep 21, 2016, 3:23:52 PM9/21/16
to bpy...@googlegroups.com
Hi,

setting the prompt to the current working directory should already be possible in bpython (or even plain Python) with a custom displayhook (see https://docs.python.org/3/library/sys.html#sys.displayhook). The displayhook can be set for example in a PYTHONSTARTUP script (see https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP).


Cheers!
Andreas

--
You received this message because you are subscribed to the Google Groups "bpython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bpython+unsubscribe@googlegroups.com.
To post to this group, send email to bpy...@googlegroups.com.
Visit this group at https://groups.google.com/group/bpython.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages