Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #57210 > unrolled thread

Re: python -c commands on windows.

Started byChris Angelico <rosuav@gmail.com>
First post2013-10-22 08:26 +1100
Last post2013-10-22 08:26 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: python -c commands on windows. Chris Angelico <rosuav@gmail.com> - 2013-10-22 08:26 +1100

#57210 — Re: python -c commands on windows.

FromChris Angelico <rosuav@gmail.com>
Date2013-10-22 08:26 +1100
SubjectRe: python -c commands on windows.
Message-ID<mailman.1324.1382390796.18130.python-list@python.org>
On Tue, Oct 22, 2013 at 8:14 AM,  <random832@fastmail.us> wrote:
> C:\>python -c a=1^
> More?
> More? print(a)
> 1

Note that you have to hit enter *twice* for this to work. (I'm not
sure why; the caret is supposed to escape the newline, but that
doesn't explain this. For all I know, it could be an ascended bug[1].)
Also, if you want to indent a subsequent line, you'll (obviously) have
to quote it (at least, if you use spaces; I don't know of a way to
insert a tab character), so this gets ugly REAL fast for conditionals:

C:\Python33>python -c "if True:"^
More?
More? " print(1)"^
More?
More? else":"^
More?
More? " print(2)"
1

Makes bash look pretty awesome!

ChrisA

[1] http://tvtropes.org/pmwiki/pmwiki.php/Main/AscendedGlitch

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web