From: Peter C. N. <spa...@le...> - 2005-02-25 16:24:24
|
I've tried to copy and paste code from the editor window to the shell, but it seems that once multiple lines are pasted that the shell doesn't evaluate the code. Its in the command line history as a block that I can return to using <ctrl>-<up-arrow>, but when I hit enter its not evaluated again. Is this something fixed? This is in the debian pythoncard distribution. An example of this is the following snippet: >>> time = "now" ... second_part = "is the time" ... if time == "now": ... print second_part >>> >>> time = "now" ... second_part = "is the time" ... if time == "now": ... print second_part >>> [ Starting herer is where I did a line-by-line cut-n-paste] >>> time = "now" >>> second_part = "is the time" >>> if time == "now": ... print second_part ... is the time >>> -Peter -- The 5 year plan: In five years we'll make up another plan. Or just re-use this one. |
From: Liam C. <cy...@gm...> - 2005-02-26 11:35:27
|
Hi Peter, AFAIK this is an issue with all Python shells, from IDLE through to PythonWin. Although, you can paste line by line IIRC. Regards, Liam Clarke On Fri, 25 Feb 2005 08:24:22 -0800, Peter C. Norton <spa...@le...> wrote: > I've tried to copy and paste code from the editor window to the shell, > but it seems that once multiple lines are pasted that the shell > doesn't evaluate the code. Its in the command line history as a block > that I can return to using <ctrl>-<up-arrow>, but when I hit enter its > not evaluated again. > > Is this something fixed? This is in the debian pythoncard > distribution. > > An example of this is the following snippet: > > >>> time = "now" > ... second_part = "is the time" > ... if time == "now": > ... print second_part > >>> > >>> time = "now" > ... second_part = "is the time" > ... if time == "now": > ... print second_part > >>> > [ Starting herer is where I did a line-by-line cut-n-paste] > >>> time = "now" > >>> second_part = "is the time" > >>> if time == "now": > ... print second_part > ... > is the time > >>> > > -Peter > > -- > The 5 year plan: > In five years we'll make up another plan. > Or just re-use this one. > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > -- 'There is only one basic human right, and that is to do as you damn well please. And with it comes the only basic human duty, to take the consequences. |
From: Kevin A. <al...@se...> - 2005-02-26 16:01:16
|
http://pythoncard.sourceforge.net/shell.html Ctrl+Shift+V is what you're looking for to run multiple lines from a paste. ka On Feb 25, 2005, at 8:24 AM, Peter C. Norton wrote: > I've tried to copy and paste code from the editor window to the shell, > but it seems that once multiple lines are pasted that the shell > doesn't evaluate the code. Its in the command line history as a block > that I can return to using <ctrl>-<up-arrow>, but when I hit enter its > not evaluated again. > > Is this something fixed? This is in the debian pythoncard > distribution. > > An example of this is the following snippet: > >>>> time = "now" > ... second_part = "is the time" > ... if time == "now": > ... print second_part >>>> >>>> time = "now" > ... second_part = "is the time" > ... if time == "now": > ... print second_part >>>> > [ Starting herer is where I did a line-by-line cut-n-paste] >>>> time = "now" >>>> second_part = "is the time" >>>> if time == "now": > ... print second_part > ... > is the time >>>> > > -Peter > > -- > The 5 year plan: > In five years we'll make up another plan. > Or just re-use this one. |
From: Peter C. N. <spa...@le...> - 2005-02-26 17:35:06
|
On Sat, Feb 26, 2005 at 08:00:26AM -0800, Kevin Altis wrote: > http://pythoncard.sourceforge.net/shell.html > > Ctrl+Shift+V is what you're looking for to run multiple lines from a > paste. > > ka Hmm... this almost works. However it now messes up the indentation on the way into the python shell. I.e.: var = "boogie" if "bookie" == var: print "test" else: print "not boogie" becomes: var = "boogie" if "bookie" == var: pass else: print "not boogie" File "<input>", line 3 else: ^ SyntaxError: invalid syntax var = "boogie" if "bookie" == var: print "test" else: print "not boogie" File "<input>", line 3 else: ^ SyntaxError: invalid syntax Copy-n-paste from the shell is eliminating the ">>>" and "..." from the output, but you know where they are. Does anyone know if the shell can be made to not try to autoindent on paste? -Peter -- The 5 year plan: In five years we'll make up another plan. Or just re-use this one. |
From: Kevin A. <al...@se...> - 2005-02-26 18:56:13
|
On Feb 26, 2005, at 9:34 AM, Peter C. Norton wrote: > On Sat, Feb 26, 2005 at 08:00:26AM -0800, Kevin Altis wrote: >> http://pythoncard.sourceforge.net/shell.html >> >> Ctrl+Shift+V is what you're looking for to run multiple lines from a >> paste. >> >> ka > > Hmm... this almost works. However it now messes up the indentation on > the way into the python shell. > > I.e.: > > var = "boogie" > if "bookie" == var: > print "test" > else: > print "not boogie" > > becomes: > > var = "boogie" > if "bookie" == var: > pass > else: > print "not boogie" > File "<input>", line 3 > else: > ^ > SyntaxError: invalid syntax > var = "boogie" > if "bookie" == var: > print "test" > else: > print "not boogie" > File "<input>", line 3 > else: > ^ > SyntaxError: invalid syntax > > Copy-n-paste from the shell is eliminating the ">>>" and "..." from > the output, but you know where they are. > > Does anyone know if the shell can be made to not try to autoindent on > paste? > > -Peter > This should work, but it is broken for me too, so this is a bug and I'm not sure if it is Pycrust or my minor subclass. I'll check and report back after I look at Windows and Mac. If you do a normal copy (ctrl+c) you don't get the >>> and ... preface chars, but ctrl+shift+c will get them. Paste strips the preface characters. ka |
From: Peter C. N. <spa...@le...> - 2005-02-26 20:26:47
|
On Sat, Feb 26, 2005 at 10:55:28AM -0800, Kevin Altis wrote: > This should work, but it is broken for me too, so this is a bug and I'm > not sure if it is Pycrust or my minor subclass. I'll check and report > back after I look at Windows and Mac. I just checked this under macosx jaguar with the same results. > If you do a normal copy (ctrl+c) you don't get the >>> and ... preface > chars, but ctrl+shift+c will get them. Paste strips the preface > characters. Good to know, thanks. -Peter -- The 5 year plan: In five years we'll make up another plan. Or just re-use this one. |