How do I change the "putty" title in python?

It works when python is enabled:

```
# python
>>> import sys
>>> sys.stdout.write("\x1b]2;Another Title\x07")

```

The following does NOT WORK:

in py:

```
# ./myscript

```

myscript:

```
#!/usr/bin/python
import sys
sys.stdout.write("\x1b]2;Another Title\x07")

```

echo

```
# echo "\x1b]2;Another Title\x07"
\x1b]2;Another Title\x07

```

echo -e

```
# echo -e "\x1b]2;Another Title\x07"

```

print

```
# print
-bash: print: command not found

```