<div dir="ltr"><div><div>I try to make plugin to read shapefile with plugin builder in QGIS and i try to import pyshp in plugin to read shapefiles but i got this error message<br><br> Traceback (most recent call last):<br>
  File "C:\Users\Mr.Pakde/.qgis2/python/plugins\shpread\shpreaddialog.py", line 42, in baca<br>    shapefile.Reader("shapefiles/blockgroups")<br>  File "C:\Users\Mr.Pakde/.qgis2/python/plugins\shpread\shapefile.py", line 220, in __init__<br>
    self.load(args[0])<br>  File "C:\Users\Mr.Pakde/.qgis2/python/plugins\shpread\shapefile.py", line 253, in load<br>    raise ShapefileException("Unable to open %s.shp" % shapeName)<br>ShapefileException: Unable to open shapefiles/blockgroups.shp<br>
<br>Python version:<br>2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]<br><br></div>------and this is code i use ( i put it in dialog.py)-------<br><br># insert every signal connection here!<br>        cariButton = self.ui.btnShp<br>
        QtCore.QObject.connect(cariButton, QtCore.SIGNAL('clicked()'),self.baca)<br><br>    def baca(self):<br>        sf = QtGui.QFileDialog.getOpenFileName(self, 'Open File', '*.shp')<br>        shapefile.Reader("shapefiles/blockgroups")<br>
        shapes = sf.shapes()<br>        # Read the bounding box from the 4th shape<br>        shapes[3].bbox<br>        [-122.485792, 37.786931000000003, -122.446285, 37.811019000000002]<br>        #  Read the 8th point in the 4th shape<br>
        shapes[3].points[7]<br>        [-122.471063, 37.787402999999998]<br>        <br>        #panggil isi data<br>        self.isiDataFile(sf)<br><br>    def isiDataFile(self, nmfile):<br>        #buka dengan open mode baca<br>
        teksFile = open(nmfile, 'r').read()<br><br>        self.ui.textShp.setText(teksFile)<br><br><br></div><div>can someone help me?<br></div></div>