[Python] ciao sono nuovo, ma si trova la documentazione ?

Carlo Miron miron a python.it
Mar 27 Feb 2018 18:48:22 CET


2018-02-27 18:20 GMT+01:00 Iguana Igua <mystic.dooor a gmail.com>:

> Per esempio io voglio conoscere la descrizione di un pacchetto.
> So che il pacchetto è python2.7 e che lo trovo dentro la cache.
> Quindi:
> cache=apt.Cache()
> pkg=cache['python2.7']
> e da qui come arrivo a:
> pkg.version[0].description
> ?
> cioè come faccio a trovare description ?

```
>>> import apt
>>> cache=apt.Cache()
>>> pkg=cache['python2.7']
>>> ver=pkg.versions[0]
>>> dir(ver)
['__class__', '__delattr__', '__dict__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__',
'__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__',
'__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_cand',
'_cmp', '_records', '_translated_records', '_uris', 'architecture',
'dependencies', 'description', 'downloadable', 'enhances',
'fetch_binary', 'fetch_source', 'filename', 'get_dependencies',
'homepage', 'installed_size', 'is_installed', 'md5', 'origins',
'package', 'policy_priority', 'priority', 'provides',
'raw_description', 'recommends', 'record', 'section', 'sha1',
'sha256', 'size', 'source_name', 'source_version', 'suggests',
'summary', 'tasks', 'uri', 'uris', 'version']
>>> type(ver)
<class 'apt.package.Version'>
>>> help(apt.package.Version)
```

㎝

-- 
| THE 🍺-WARE LICENSE (Revision ㊷)
| --
| <miron@🐍.it> wrote this mail. As long as you retain
| this notice you can do whatever you want with this stuff.
| If we meet some day, and you think this stuff is worth it,
| you can buy me a 🍺 in return. -- Carlo Miron


Maggiori informazioni sulla lista Python