From python3 onwards wnck is part of the GObject Introspection API. You can presently get access to wnck3 in python3 on Debian (and therefore I presume identically on Ubuntu) with:
apt-get install python3-gi gir1.2-wnck-3.0
Obviously the gir- and wnck- versions will vary over time (or you may need e.g. an older version of wnck), but:
apt-cache search 'gir.*wnck'
should be enough for finding what you want. I personally prefer to leverage the power of aptitude-search with
aptitude search '?depends(libgirepository) wnck'
Due to the flexibility of the Introspection API, importing is slightly more complex, for example:
>>> import gi
>>> gi.require_version('Wnck', '3.0')
>>> from gi.repository import Wnck
Documentation for python3/wnck3 can be found here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…