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
from Inputfiles_Dialog import Inputfiles_Dialog
#Inputfiles_Dialog is the ui created by QtCreater
d = Inputfiles_Dialog(self.iface)
d.show()
if d.exec_():
self.Inputfiles_set = d.getInputs()
self.connect(self.OK_buttonBox, SIGNAL("accepted()"),self.ProcessInfo)4. In your custom dialg, add a function to return values:
.
.
.
def ProcessInfo(self):
#do somthing
.
.
.
self.accept()
def getInputs(self):
return usefulinfo
Copyright (c) 2010 Python Code Blog All rights reserved. Design by CSS Templates | Blogger Templates by TeknoMobi | Sponsored by Bodrum48.