@@ -64,7 +64,7 @@ A very simple listing of zones within your account; including the IPv6 status of
6464 for zone in zones:
6565 zone_id = zone[' id' ]
6666 zone_name = zone[' name' ]
67- print zone_id, zone_name
67+ print ( " zone_id= %s zone_name= %s " % ( zone_id, zone_name))
6868
6969 if __name__ == ' __main__' :
7070 main()
@@ -90,7 +90,8 @@ Now lets expand on that and add code to show the IPv6 and SSL status of the zone
9090 settings_ipv6 = cf.zones.settings.ipv6.get(zone_id)
9191 ipv6_status = settings_ipv6[' value' ]
9292
93- print zone_id, zone_name, ssl_status, ipv6_status
93+ print (" zone_id=%s zone_name=%s " % (zone_id, zone_name))
94+ print (" ssl_status=%s ipv6_status=%s " % (ssl_status, ipv6_status))
9495
9596 if __name__ == ' __main__' :
9697 main()
@@ -114,7 +115,7 @@ Raw mode is only needed when a get request has the possibility of returning many
114115 for zone in zones:
115116 zone_id = zone[' id' ]
116117 zone_name = zone[' name' ]
117- print zone_id, zone_name
118+ print ( " zone_id= %s zone_name= %s " % ( zone_id, zone_name))
118119
119120 total_pages = raw_results[' result_info' ][' total_pages' ]
120121 if page_number == total_pages:
@@ -156,15 +157,15 @@ A more complex example follows.
156157 exit (' /zones/dns_records.get %d %s - api call failed' % (e, e))
157158
158159 # print the results - first the zone name
159- print zone_id, zone_name
160+ print ( " zone_id= %s zone_name= %s " % ( zone_id, zone_name))
160161
161162 # then all the DNS records for that zone
162163 for dns_record in dns_records:
163164 r_name = dns_record[' name' ]
164165 r_type = dns_record[' type' ]
165166 r_value = dns_record[' content' ]
166167 r_id = dns_record[' id' ]
167- print ' \t ' , r_id, r_name, r_type, r_value
168+ print ( ' \t ' , r_id, r_name, r_type, r_value)
168169
169170 exit (0 )
170171
@@ -326,7 +327,7 @@ You can return all the paging values by calling the class with raw=True. Here’
326327 def main ():
327328 cf = CloudFlare.CloudFlare()
328329 zones = cf.zones.get(params = {' per_page' :5 })
329- print len (zones)
330+ print ( " len= %d " % (zones.length()) )
330331
331332 if __name__ == ' __main__' :
332333 main()
@@ -349,8 +350,8 @@ When you add the raw option; the APIs full structure is returned. This means the
349350 def main ():
350351 cf = CloudFlare.CloudFlare(raw = True )
351352 zones = cf.zones.get(params = {' per_page' :5 })
352- print zones.length()
353- print json.dumps(zones, indent = 4 , sort_keys = True )
353+ print ( " len= %d " % ( zones.length()) )
354+ print ( json.dumps(zones, indent = 4 , sort_keys = True ) )
354355
355356 if __name__ == ' __main__' :
356357 main()
@@ -923,7 +924,7 @@ This can also be done via Python code with the following example.
923924 for l in dns_records.splitlines():
924925 if len(l) == 0 or l[0] == ';':
925926 continue
926- print l
927+ print(l)
927928 exit(0)
928929
929930 if __name__ == '__main__':
0 commit comments