I am newbie to python so please ignore if this is stupid. Here, I am getting Invalid syntax while printing the data in some specified format.
with open("ip_services.xyz", "w") as handle:
for service in sorted(...some functionality...)):
print("ip_server(\"{}\", {}, {}, {}, {}, {}, {}) # {}, {}".format(
service.address, service.port, 1 if service.udp else 0,
service.service_id, service.instance_id,
service.major_version, service.minor_version,
service.xyz,
service.service_name),
file=handle)
Error is like :-
File "producer.py", line 220
print("{} = \"{}\" # {}".format(signal, value, label), file=handle)
^
SyntaxError: invalid syntax