Here is the solution to your problem.
create a file named "ear1" and make it look like this:
Code:
#!/bin/bash
NUM="0"
cd /
whoami
echo test
while [ $NUM -lt 10 ]; do
echo $[$NUM+1]
NUM=$[$NUM + 1]
sleep 1
done
type:
then make your python file look like the following:
Code:
#!/usr/bin/env python
import os
import gtk
import vte
import time
from subprocess import Popen, PIPE
def show_callback(terminal):
terminal.feed_child('./ear1')
def write(terminal, text):
x, y = terminal.get_cursor_position()
terminal.feed(text + '\n', len(text) + 1)
window = gtk.Window()
window.connect('destroy', lambda w: gtk.main_quit())
terminal = vte.Terminal()
terminal.fork_command()
terminal.connect("show", show_callback)
#write(terminal, '1234567890')
window.add(terminal)
window.show_all()
gtk.main()
in other words you will have to make it run a bash script
Bookmarks