Skip to main content
Notice removed Draw attention by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Notice added Draw attention by maddingl
Bounty Started worth 50 reputation by maddingl
added home directory before .python_history
Source Link
maddingl
  • 706
  • 2
  • 8
  • 24

Change location of ``~/.python_history`

I want to keep the functionality, but change the location of ~/.python_history to $XDG_DATA_HOME/python/python_history.

This gave me the following idea: I could create $XDG_CONFIG_HOME/python/pythonrc and point $PYTHONSTARTUP to it. In there I want to replace the functions readline.read_history_file, readline.write_history_file and readline.append_history_file.

Is there way to replace these functions with themselves, containing a custom filename argument?

If not, do you have another idea how to approach this?

Change location of `.python_history`

I want to keep the functionality, but change the location of .python_history to $XDG_DATA_HOME/python/python_history.

This gave me the following idea: I could create $XDG_CONFIG_HOME/python/pythonrc and point $PYTHONSTARTUP to it. In there I want to replace the functions readline.read_history_file, readline.write_history_file and readline.append_history_file.

Is there way to replace these functions with themselves, containing a custom filename argument?

If not, do you have another idea how to approach this?

Change location of `~/.python_history`

I want to keep the functionality, but change the location of ~/.python_history to $XDG_DATA_HOME/python/python_history.

This gave me the following idea: I could create $XDG_CONFIG_HOME/python/pythonrc and point $PYTHONSTARTUP to it. In there I want to replace the functions readline.read_history_file, readline.write_history_file and readline.append_history_file.

Is there way to replace these functions with themselves, containing a custom filename argument?

If not, do you have another idea how to approach this?

Source Link
maddingl
  • 706
  • 2
  • 8
  • 24

Change location of `.python_history`

I want to keep the functionality, but change the location of .python_history to $XDG_DATA_HOME/python/python_history.

This gave me the following idea: I could create $XDG_CONFIG_HOME/python/pythonrc and point $PYTHONSTARTUP to it. In there I want to replace the functions readline.read_history_file, readline.write_history_file and readline.append_history_file.

Is there way to replace these functions with themselves, containing a custom filename argument?

If not, do you have another idea how to approach this?