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

Herman sorsorday at gmail.com
Fri Oct 12 18:51:19 EDT 2012


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



More information about the Python-list mailing list