Comment: module, and MiniSSDPd reference

This commit is contained in:
Sander Jonkers 2021-01-08 13:52:04 +01:00 committed by Thomas Bernard
parent 1ae60f2a6c
commit 0ac25c1a92
1 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,8 @@
#!/usr/bin/env python3
# vim: sw=4 ts=4 expandtab
# (c) 2021 Thomas BERNARD
# Python 3 : code sample
# Python3 module to submit service to running MiniSSDPd
# MiniSSDPd: See http://miniupnp.free.fr/minissdpd.html
import socket, os
@ -11,7 +12,7 @@ def codelength(s):
if not isinstance(s, bytes):
# Not bytes. Let's try to convert to bytes, but only plain ASCII
try:
s = str.encode(s,"ascii")
s = str.encode(s, "ascii")
except:
s = b''
l = len(s)