8.5.1 Oggetti dl

Gli oggetti dl restituiti dalla funzione open() precedente, possiedono i seguenti metodi:

close( )
Libera tutte le risore, eccetto la memoria.

sym( name)
Restituisce il puntatore per la funzione chiamata name, sotto forma di numero, se esiste nell'oggetto condiviso referenziato, altrimenti restituisce None. Questo è utile in codice del tipo:

>>> if a.sym('time'): 
...     a.call('time')
... else: 
...     time.time()

(Notate che questa funzione restituirà un numero diverso da zero, visto che zero è il puntatore NULL)

call( name[, arg1[, arg2...]])
Chiama la funzione denominata name, nell'oggetto condiviso referenziato. Gli argomenti devono essere o interi Python, che verranno passati così come sono, o stringhe Python, alle quali verrà passato un puntatore, o None, che verrà passato come NULL. Notate che le stringhe dovrebbero venir passate alle funzioni solamente come const char*, visto che a Python non piace mutare le proprie strighe.

Devono esserci al massimo 10 argomenti, e gli argomenti non forniti verranno trattati come None. Il valore restituito dalla funzione deve essere un long C, che è un intero Python.

Vedete Circa questo documento... per informazioni su modifiche e suggerimenti.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy