Skip to content
Snippets Groups Projects
Commit c82d537b authored by Amandine  PERRIN's avatar Amandine PERRIN
Browse files

Possibility to change separator in list_to_str

parent 566fca5a
No related branches found
No related tags found
No related merge requests found
......@@ -1220,7 +1220,7 @@ def write_list(list_names, fileout):
fo.write(genome + "\n")
def list_to_str(list):
def list_to_str(list, sep='\t'):
"""
Return a string corresponding to the given list, with all elements separated
by a space. Used to write a list into a file. Ex::
......@@ -1231,6 +1231,8 @@ def list_to_str(list):
----------
list : list
list of elements that we would like to write
sep : str
Separator to use between the different elements
Returns
-------
......@@ -1238,7 +1240,7 @@ def list_to_str(list):
the string to write
"""
list_write = [str(l) for l in list]
return " ".join(list_write) + "\n"
return sep.join(list_write) + "\n"
def remove(infile):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment