This is the code:
f = open(filename, 'w')
f.write("hello\talex")
The \t
inside the string is the escape sequence for the horizontal tabulation.
More Related Contents:
- Selenium Switch Tabs
- How to open multiple webpages in separate tabs within a browser using selenium-webdriver and python
- Python’s interpretation of tabs and spaces to indent
- parsing a tab-separated file in Python
- How do I list all files of a directory?
- Reference template variable within Jinja expression
- Generate random numbers with a given (numerical) distribution
- Getting the index of the returned max or min item using max()/min() on a list
- Edit Distance in Python
- Implementation HMAC-SHA1 in python
- Python list directory, subdirectory, and files
- Add params to given URL in Python
- Integer overflow in numpy arrays
- String with ‘f’ prefix in python-3.6
- Python CSV to SQLite
- How to configure pymssql with SSL support on Ubuntu?
- spawning process from python
- fabric password
- Evaluate sympy expression from an array of values
- Is freeing handled differently for small/large numpy arrays?
- How can repetitive rows of data be collected in a single row in pandas?
- Identify groups of consecutive numbers in a list
- How can I use cookies in Python Requests?
- Docker- django throws error while connecting to postgres: psycopg2.OperationalError: could not connect to server: Connection refused
- How to find pg_config path
- Python: How to make drawn elements snap to grid in pygame
- Resample time series in pandas to a weekly interval
- How to create a grouped bar chart in Altair?
- How can I run a Python script in HTML?
- Multiple lookup_fields for django rest framework