Entry
Converter space indentation -> tab indentation
Jul 5th, 2000 10:03
Nathan Wallace, Hans Nowak, Snippet 317, Magnus L. Hetland
"""
Packages: text
"""
"""
> I'm looking for a converter that converts Python files
> with space indentation -> tab indentation.
How about a simple script like this?
"""
# -- start --
#!/usr/bin/env python
import sys, string
line = sys.stdin.readline()
while line:
print string.replace(line," ","\t"),
line = sys.stdin.readline()
# -- stop --
"""
It worked on my source files (from emacs with python-mode).
"""