Registers pyplot.draw as inputhook for prompt_toolkit

This commit is contained in:
clothespin
2021-03-15 20:49:52 -07:00
parent fd5c174d84
commit 0573a583be

View File

@@ -1,11 +1,13 @@
import os
from matplotlib import pyplot
from prompt_toolkit import PromptSession
from prompt_toolkit.history import FileHistory
history_file = os.path.join(os.path.expanduser("~"), ".gamestonk_terminal.his")
try:
session = PromptSession(history=FileHistory(history_file))
session = PromptSession(history=FileHistory(history_file), inputhook=pyplot.draw())
except Exception as e: # noqa: F841
session = None