To run nmap
in a new xterm
window, you could use -e
option:
#!/usr/bin/env python
import subprocess
subprocess.Popen(['xterm', '-e', 'bash -c "sudo nmap -v -sS -O 10.2.2.2; read"'])
read
is appended to wait for Enter after nmap
exits before closing the window.
More Related Contents:
- Python returns "SyntaxError: invalid syntax sys module" [closed]
- Execute python script while open terminal
- How do I execute a program or call a system command?
- How to terminate a python subprocess launched with shell=True
- How to use `subprocess` command with pipes
- ImageMagick not authorized to convert PDF to an image
- How to get Linux console window width in Python
- Python spawn off a child subprocess, detach, and exit
- Launch a completely independent process
- Add pygame module in PyCharm IDE
- Execute terminal command from python in new terminal window?
- How to terminate process from Python using pid?
- How to get PID by process name?
- Python: how to kill child process(es) when parent dies?
- How to kill a python child process created with subprocess.check_output() when the parent dies?
- Linux command-line call not returning what it should from os.system?
- Cross-platform subprocess with hidden window
- Display realtime output of a subprocess in a tkinter widget
- How to get output from subprocess.Popen(). proc.stdout.readline() blocks, no data prints out
- ‘yes’ reporting error with subprocess communicate()
- How do i use subprocesses to force python to release memory?
- Understanding python subprocess.check_output’s first argument and shell=True [duplicate]
- Sending a password over SSH or SCP with subprocess.Popen
- ‘^’ is ignored by Python – how to escape ‘^’ character in Popen Windows?
- What is different between makedirs and mkdir of os?
- Switch between python 2.7 and python 3.5 on Mac OS X
- Read file with timeout in Python
- Cannot find the file specified when using subprocess.call(‘dir’, shell=True) in Python
- How to install and import Python modules at runtime
- subprocess.Popen in different console