Browse code

print 에러 수정

Ikseon Kang authored on30/11/2019 14:48:36
Showing1 changed files
... ...
@@ -2,26 +2,26 @@ import shapefile
2 2
 
3 3
 sf = shapefile.Reader("pyshp/shapefiles/blockgroups")
4 4
 
5
-print sf.shapeType
5
+print (sf.shapeType)
6 6
 
7 7
 shapes = sf.shapes()
8 8
 
9
-print len(shapes)
9
+print (len(shapes))
10 10
 
11 11
 s = sf.shape(7)
12
-print ['%.3f' % coord for coord in s.bbox]
12
+print (['%.3f' % coord for coord in s.bbox])
13 13
 
14 14
 for name in dir(shapes[3]):
15 15
     if not name.startswith('_'):
16
-        print name
16
+        print (name)
17 17
 
18 18
 
19 19
 fields = sf.fields
20
-print fields
20
+print (fields)
21 21
 
22 22
 shapeRecs = sf.shapeRecords()
23 23
 
24
-print len(shapeRecs)
24
+print (len(shapeRecs))
25 25
 
26
-print shapeRecs[0].record[1:3]
27
-print shapeRecs[0].shape.points[0:2]
26
+print (shapeRecs[0].record[1:3])
27
+print (shapeRecs[0].shape.points[0:2])
Browse code

예제 파일 내용 저장

Ikseon authored on07/07/2018 14:54:16
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,27 @@
1
+import shapefile
2
+
3
+sf = shapefile.Reader("pyshp/shapefiles/blockgroups")
4
+
5
+print sf.shapeType
6
+
7
+shapes = sf.shapes()
8
+
9
+print len(shapes)
10
+
11
+s = sf.shape(7)
12
+print ['%.3f' % coord for coord in s.bbox]
13
+
14
+for name in dir(shapes[3]):
15
+    if not name.startswith('_'):
16
+        print name
17
+
18
+
19
+fields = sf.fields
20
+print fields
21
+
22
+shapeRecs = sf.shapeRecords()
23
+
24
+print len(shapeRecs)
25
+
26
+print shapeRecs[0].record[1:3]
27
+print shapeRecs[0].shape.points[0:2]