MacOS 10.11.6上IDLE Python 3.7.1 shell窗口中的以下代码片段导致语法错误。
解决办法是什么?
在终端python 2.7.10或python3中运行的相同代码不会导致错误。
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
>>> import subprocess
from time import strftime
import time
SyntaxError: multiple statements found while compiling a single statement
>>>