listname[:] = []
Example:
>>fruit = ['apple', 'orange','lemon']
>>print fruit
['apple', 'orange', 'lemon']
>>len(fruit)
3
>>fruit[:]=[]
>>print fruit
[]
>>len(fruit)
0
QGIS Plugin and Python coding
listname[:] = []
>>fruit = ['apple', 'orange','lemon']
>>print fruit
['apple', 'orange', 'lemon']
>>len(fruit)
3
>>fruit[:]=[]
>>print fruit
[]
>>len(fruit)
0
Copyright (c) 2010 Python Code Blog All rights reserved. Design by CSS Templates | Blogger Templates by TeknoMobi | Sponsored by Bodrum48.