So, you have to remove it manually unlike Java you can read line in Scanner class.
f = open(...) # Open file f.readline().rstrip('\n') # Remove last character or f.readline()[:-1] # Remove last character
|
Hi, I'm Veerapat Sriarunrungrueang, an expert in technology field, especially full stack web development and performance testing.This is my coding diary. I usually develop and keep code snippets or some tricks, and update to this diary when I have time.
Nowadays, I've been giving counsel to many well-known firms in Thailand.
view more... |
f = open(...) # Open file f.readline().rstrip('\n') # Remove last character or f.readline()[:-1] # Remove last character
No comments:
Post a Comment