mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									1af03e98d9
								
							
						
					
					
						commit
						dac238bd46
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -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' | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jack Jansen
						Jack Jansen