Files
Sheerka-Old/core/utils.py
T
2019-10-21 16:13:56 +02:00

21 lines
381 B
Python

def sysarg_to_string(argv):
"""
Transform a list of strings into a single string
Add quotes if needed
:return:
"""
if argv is None or not argv:
return ""
result = ""
first = True
for s in argv:
if not first:
result += " "
result += '"' + s + '"' if " " in s else s
first = False
return result