1 import os
, sys
, readline
as pyreadline
4 histfile
= os
.path
.expanduser("~/.mal-history")
5 if sys
.version_info
[0] >= 3:
10 def readline(prompt
="user> "):
12 if not history_loaded
:
15 with
open(histfile
, "r") as hf
:
16 for line
in hf
.readlines():
17 pyreadline
.add_history(line
.rstrip("\r\n"))
20 #print("Could not open %s" % histfile)
25 pyreadline
.add_history(line
)
26 with
open(histfile
, "a") as hf
: