如何解决"IndentationError: unexpected indent"



我正在运行Kali Linux,需要完成大量命令,但我正在编写一个脚本来真正加快速度

import os
if raw_input("Begin fake Access Point? (y/n): ")=="y":
 os.system(airmon-ng)
interface = input("Enter your Interface name: ")
 os.system(airmon-ng "interface" start)

我在尝试运行它时遇到了这个错误:

  File "WNS.py", line 7
    os.system(airmon-ng "interface" start) 
    ^
IndentationError: unexpected indent

一开始试图删除空白,但后来我得到了这个错误:

IndentationError: expected an indented block

淹没在Python中非常重要。解释器使用它来了解如何对指令块进行定界。os.system()调用的参数看起来也不太好。不管怎样,这就是它看起来像的样子

import os
if raw_input("Begin fake Access Point? (y/n): ")=="y":
    os.system("airmon-ng")
interface = input("Enter your Interface name: ")
os.system("airmon-ng "+interface+" start")

相关内容

  • 没有找到相关文章

最新更新