Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23247

Python - How to Write Text to a GTK+ Vte Terminal widget?

$
0
0

I'm trying to use a Vte terminal widget to display text from my python script.

I'm not setting the working directory or emulator, I just want a empty terminal that handles text and ansi escape sequences

I have this piece of code, it works in python 2.7:

import gigi.require_version('Gtk', '3.0')gi.require_version('Vte', '2.91')from gi.repository import Gtk, Vtefrom gi.repository import GLibimport osterminal     = Vte.Terminal()terminal.spawn_sync(    Vte.PtyFlags.DEFAULT,    None,    [],    [],    GLib.SpawnFlags.DO_NOT_REAP_CHILD,    None,    None,    )win = Gtk.Window()win.connect('delete-event', Gtk.main_quit)win.add(terminal)win.show_all()terminal.feed('hello') #string to displayGtk.main()

but it doesn't work in python 3.5, all I get is a blank terminal.


Viewing all articles
Browse latest Browse all 23247

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>