[英]How to take multiple "user input" stored in a file (e.g., *.inp) in terminal for python script
[英]How do I create a script that will take user input and use it in a terminal command using python 3.6?
我正在尝试在Linux上的python3.6中编写一个脚本,该脚本接受用户的输入(以URL的形式),然后在提供的输入上执行“ whois”终端命令。 我正在尝试从IDLE启动它。 我最好的是:
import os
os.system("clear")
os.system("gnome-terminal -e 'bash -c \'")
w = ""
w = (input("Who is your target?" ))
os.system("whois " + w)
似乎在输入之后,gnome终端没有打开,什么也没有发生。 目前,我对python的了解还不是很丰富,为此我正苦苦挣扎!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.