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


Groups > comp.lang.python > #31175

How to use "while" within the command in -c option of python?

Date 2012-10-12 15:51 -0700
Subject How to use "while" within the command in -c option of python?
From Herman <sorsorday@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2100.1350082282.27098.python-list@python.org> (permalink)

Show all headers | View raw


 python -c "import os; while True: print('hello')"
 File "<string>", line 1
 import os; while True: print('hello')
                      ^
SyntaxError: invalid syntax

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

How to use "while" within the command in -c option of python? Herman <sorsorday@gmail.com> - 2012-10-12 15:51 -0700

csiph-web