diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-05-26 20:01:41 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-05-26 20:01:41 (GMT) |
commit | dac238bd46e95d1736cd6bee11df850a508f433b (patch) | |
tree | a3053005a91145a59c1f44dc0d27ef9eebdd7495 /Mac | |
parent | 1af03e98d9ab87b4e9aa76caafba0dbc52cfd750 (diff) | |
download | cpython-dac238bd46e95d1736cd6bee11df850a508f433b.zip cpython-dac238bd46e95d1736cd6bee11df850a508f433b.tar.gz cpython-dac238bd46e95d1736cd6bee11df850a508f433b.tar.bz2 |
When reading from stdin (with the dialog box) use any partial line on
stdout as the prompt. This makes raw_input() and print "xxx", ; sys.stdin.readline() work a bit more palatable.
Diffstat (limited to 'Mac')
-rw-r--r-- | Mac/Tools/IDE/PyConsole.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Mac/Tools/IDE/PyConsole.py b/Mac/Tools/IDE/PyConsole.py index fb8b439..ea2cf83 100644 --- a/Mac/Tools/IDE/PyConsole.py +++ b/Mac/Tools/IDE/PyConsole.py @@ -340,8 +340,15 @@ class SimpleStdin: def readline(self): import EasyDialogs + # A trick to make the input dialog box a bit more palatable + if hasattr(sys.stdout, '_buf'): + prompt = sys.stdout._buf + else: + prompt = "" + if not prompt: + prompt = "Stdin input:" sys.stdout.flush() - rv = EasyDialogs.AskString("") + rv = EasyDialogs.AskString(prompt) if rv is None: return "" return rv + '\n' |