read Windows/Unix, write Unix line endings
This commit is contained in:
parent
f3cf67d3fa
commit
0916922423
|
@ -280,7 +280,7 @@ class Table:
|
|||
else:
|
||||
shapes[label] = (1,)
|
||||
|
||||
data = pd.read_csv(f,names=list(range(len(labels))),sep=r'\s+',lineterminator='\n')
|
||||
data = pd.read_csv(f,names=list(range(len(labels))),sep=r'\s+')
|
||||
|
||||
return Table(shapes,data,comments)
|
||||
|
||||
|
|
|
@ -224,7 +224,8 @@ def open_text(fname: FileHandle,
|
|||
f : file handle
|
||||
|
||||
"""
|
||||
return open(Path(fname).expanduser(),mode,newline='\n') if isinstance(fname, (str, Path)) else fname
|
||||
return fname if not isinstance(fname, (str,Path)) else \
|
||||
open(Path(fname).expanduser(),mode,newline=('\n' if mode == 'w' else None))
|
||||
|
||||
|
||||
def natural_sort(key: str) -> List[Union[int, str]]:
|
||||
|
|
Loading…
Reference in New Issue