代码:
[root@oracle-cluster-3 python]# python -V Python 2.7.5 [root@oracle-cluster-3 python]# [root@oracle-cluster-3 python]# pwd /script/python [root@oracle-cluster-3 python]# [root@oracle-cluster-3 python]# ls -ltr total 4 -rw-r--r-- 1 root root 124 May 12 10:33 isDirectory.py [root@oracle-cluster-3 python]# [root@oracle-cluster-3 python]# cat isDirectory.py import os if os.path.isdir("/script"): print "dir /script is direcotry." else: print "dir /script is not direcotry." [root@oracle-cluster-3 python]# [root@oracle-cluster-3 python]# python isDirectory.py dir /script is direcotry. [root@oracle-cluster-3 python]#
————————————
Done。