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

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -