python - How can I read a text file without any newline or tab characters? -
i have rather long sql query want use in python.
rather type sql query, or paste it, i'd read text file.
however, when like
with open(file,'r') f: s = f.read() the resulting string has new line characters. how can read in string without of formating characters?
note: s.replace('\n',' ' ) suppose file large read , pick out characters occur.
Comments
Post a Comment