Why do we need to add newline at the end of a file in Pycharm IDE? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why do we need to add newline at the end of a file in Pycharm IDE?

7th Jan 2023, 2:28 AM
Reniel Galang
Reniel Galang - avatar
1 Resposta
+ 6
It is a convention originating in POSIX standard. For some programs it may be significant. I guess the built-in style checker in Pycharm would warn if this condition is not satisfied. https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
7th Jan 2023, 8:44 AM
Tibor Santa
Tibor Santa - avatar