Python – Reading and writing to the console

Reading from the console and writing to it is a piece of cake in python. These two functions do it for you perfectly:

Then why am I writing a whole article about it? Well, there is something fancy, if you need to read and write more than that. E.g., if you are reading 4 numerical integers, splitted by a comma, then most probably you will not think about the following fancy options immediately. Or if you want to write from a list of different values, and to split by some other separator. Anyway, this article is mainly for me, with the idea to update it with the time, when needed. Enjoy it!

Reading

Writing

Tagged with: , , , ,