Tuesday, May 5, 2020

The Python print() Function: Go Beyond the Basics

If you’re like most Python users, including us, then you probably started your Python journey by learning about print(). It helped you write your very own Hello Horld one-liner. You can use it to display formatted messages onto the screen and perhaps find some bugs. But if you think that’s all there is to know about Python’s print(), then you’re missing out on a lot!

Keep reading to take full advantage of this underappreciated little function. This course will get you up to speed with using Python print() effectively. Prepare for a deep dive as you go through the sections. You may be surprised how much print() has to offer!

By the end of this course, you’ll know how to:

  • Avoid common mistakes with Python’s print()
  • Deal with newlines, character encodings, and buffering
  • Write text to files
  • Mock print() in unit tests
  • Build advanced user interfaces in the terminal

[ Improve Your Python With ๐Ÿ Python Tricks ๐Ÿ’Œ – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]



from Real Python
read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...