Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 6430  / 1 Year ago, tue, january 10, 2023, 10:46:08

How can I access the gio module for Python 3.2? (I want to interface with GVFS.) I did



sudo apt-get install python3-gobject


but this does not allow me to do



import gio


as it did in Python 2.7. Is the GIO module not provided with GObject in Python 3? How do I access it?


More From » python

 Answers
7

gio is a PyGTK module, and is not available for Python 3 because PyGTK itself is deprecated. If you want to create a GTK+ application in Python 3, you will need to use its replacement: PyGObject. In the case of Gio, you import it like this.



$ python3
Python 3.2.2 (default, Sep 5 2011, 21:17:14)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gio


Such documentation as exists can be found here. Best of luck!


[#41196] Wednesday, January 11, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ledeball

Total Points: 434
Total Questions: 121
Total Answers: 120

Location: Antigua and Barbuda
Member since Sat, Apr 24, 2021
3 Years ago
;