
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
What does "print >>" do in python?
"print >>" is a syntax to extend the standard 'print' statement so that it can be used to print to any file-like object, instead of the default sys.stdout. So it can be used to print directly to files.
Example
For example, you open a file called my_file, then you can write to it using:
>>> my_file =open("my_file") >>> print >>my_file, "Hello World"
This will write "HelloWorld" to my_file. It can also be used with other file like objects.
- Related Articles
- What does print() function do in Python?
- What does [::-1] do in Python?
- What does % do to strings in Python?
- What does reload() function do in Python?
- What does raw_input() function do in python?
- What does input() function do in python?
- What does open() function do in Python?
- What does close() function do in Python?
- What does os.pipe() function do in Python?
- What does getattr() function do in Python?
- What does hasattr() function do in Python?
- What does method time.tzset() do in Python?
- What does the &= operator do in Python?
- What does the >> operator do in Python?
- What Does while true do in Python?

Advertisements