I am trying to write a downloader script (placed in unity luncher) using python that calls wget with all the right arguments. The script extracts url from clipboard and the file name from gtk primary clipboard, the one operated by text selection or copy and middle mouse click for paste. The code is rather simple.
import gtk
from os import system as sys
url = str(gtk.clipboard_get().wait_for_text())
name = str(gtk.clipboard_get(gtk.gdk.SELECTION_PRIMARY).wait_for_text())
if name.lower()=='none' :
sys("/usr/bin/canberra-gtk-play --id='dialog-warning'")
exit(1)
sys("/usr/bin/canberra-gtk-play --id='downloading'")
com='wget -c -t 0 "%s" -O "%s"' % (url,name)
sys("gnome-terminal -e '%s'" % com)
the script opens a terminal window and pints the wget output. The problem is that closing the gnome-terminal doesnt cause wget to exit, rather it runs in the background. Is it possible to stop this from happening