1

i have an error at my generate code, this is my code

import shapefile
w=shapefile.Writer()
w.shapeType

w.field("kolom1","C")
w.field("kolom2","C")

w.record("ngek","satu")
w.record("ngok","dua")

w.point(1,1)
w.point(2,2)

w.save("soal1")

and i have this problem...

python soal1.py
Traceback (most recent call last):
  File "soal1.py", line 2, in <module>
    w=shapefile.Writer()
  File "C:\Users\Fathi-PC\AppData\Local\Programs\Python\Python36\lib\site-packages\shapefile.py", line 1029, in __init__
    raise Exception('Either the target filepath, or any of shp, shx, or dbf must be set to create a shapefile.')
Exception: Either the target filepath, or any of shp, shx, or dbf must be set to create a shapefile.

is there anyone can help me..??

Carcigenicate
  • 43,494
  • 9
  • 68
  • 117
  • It looks like it's saying you need to pass a filename to `Writer`. Did you read the documentation for the function you're trying to use? – BrenBarn Nov 17 '18 at 19:51
  • https://github.com/GeospatialPython/pyshp/blob/85b534c166acddd4e2dc322402fc6f952fd7a1da/shapefile.py#L1016 – phd Nov 17 '18 at 22:00
  • did u find solution to this question? – phoenix Feb 26 '21 at 09:15

0 Answers0