A better solution to communicate with snapd would be to use, as explained by jamesh on the snapcraft forum a long time ago[1].
It requires python3-gi and gir1.2-snapd-1 packages.
Then (see Snapd Gi doc for more info[2]):
import gi
gi.require_version('Snapd', '1')
from gi.repository import Snapd
c = Snapd.Client()
active_snaps_flag = Snapd.GetSnapsFlags(0)
for snap in c.get_snaps_sync(Snapd.GetSnapsFlags(0), None):
print(snap.props.name, snap.props.devmode)
A better solution to communicate with snapd would be to use, as explained by jamesh on the snapcraft forum a long time ago[1].
It requires python3-gi and gir1.2-snapd-1 packages.
Then (see Snapd Gi doc for more info[2]):
import gi version( 'Snapd' , '1') lags(0) sync(Snapd. GetSnapsFlags( 0), None): snap.props. name, snap.props.devmode)
gi.require_
from gi.repository import Snapd
c = Snapd.Client()
active_snaps_flag = Snapd.GetSnapsF
for snap in c.get_snaps_
print(
[1] https:/ /forum. snapcraft. io/t/how- to-communicate- with-run- snapd-socket- using-python/ 6432/4 /lazka. github. io/pgi- docs/#Snapd- 1
[2] https:/