One gripe that i hear a lot is that it's really difficult to cut and paste chunks of Python code when you're working with the interpreter because the ">>> " and "... " prompts keep getting in the way. Does anyone else often have or hear of this problem? Here is a suggested solution: for interactive mode only, the console maintains a flag "dropdots", initially false. After line = raw_input(">>> "): if line[:4] in [">>> ", "... "]: dropdots = 1 line = line[4:] else: dropdots = 0 interpret(line) After line = raw_input("... "): if dropdots and line[:4] == "... ": line = line[4:] interpret(line) The above solution depends on the fact that ">>> " and "... " are always invalid at the beginning of a bit of Python. So, if sys.ps1 is not ">>> " or sys.ps2 is not "... ", all dropdots behaviour is disabled. I realize it's not going to handle all cases (in particular mixing pasted text with typed-in text), but at least it makes it *possible* to paste code, and it's quite a simple rule. I suppose it all depends on whether or not you guys often experience this particular little irritation. Any thoughts on this? -- ?!ng
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4