Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from glob import glob
- from os import getcwd,path
- from sys import argv
- print "Wildcards" + ("-" * 35)
- print "Uso:\n"
- print "opciones : -d (Directorios),-f (Ficheros)"
- def wildcard(x,y):
- mis_archivos = glob(x)
- print "Dir: %s" %(getcwd())
- if y == "-d":
- for i in mis_archivos:
- if path.isdir(i):
- print i
- elif y == "-f":
- for i in mis_archivos:
- path.isfile(i)
- print i
- else:
- for i in mis_archivos:
- print i
- while 1:
- wild = raw_input("Wildcard :")
- arg = raw_input("Arg : ")
- if wild.lower() == "salir" or wild.lower() == "s":
- exit()
- elif arg.lower() == "salir" or arg.lower() == "s":
- exit()
- wildcard(wild,arg)
- raw_input("Press ENTER")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement