Ticket #11016: test.py

File test.py, 261 bytes (added by anonymous, 15 years ago)
Line 
1#!/usr/bin/env python
2
3import sys, os
4
5if os.path.islink(sys.argv[0]):
6 name = os.readlink(sys.argv[0])
7else:
8 name = sys.argv[0]
9pathname = os.path.abspath(name)
10(head, tail) = os.path.split(pathname)
11base = os.path.basename(head)
12print base
Back to Top