diff Mac/Tools/IDE/PyConsole.py @ 17972:401ccfcf28c3 legacy-trunk

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.
author Jack Jansen <jack.jansen@cwi.nl>
date Sat, 26 May 2001 20:01:41 +0000
parents fb31c33761c9
children c5ac6f055c62
line wrap: on
line diff
--- a/Mac/Tools/IDE/PyConsole.py	Sat May 26 19:37:54 2001 +0000
+++ b/Mac/Tools/IDE/PyConsole.py	Sat May 26 20:01:41 2001 +0000
@@ -340,8 +340,15 @@
 	
 	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'