prasad rao wrote:
hello!
I am a novice looking up to the tutor as my Guide.
I got a problem while using optional parameter.
#! user/bin/env python
import os
def myfiles(directory,extension=None):
change that to def myfiles(directory,extension=""):
for x in [os.path.join(x,i) f
Dj Gilcrease wrote:
def myfiles(directory,extension=None):
for x in [os.path.join(x,i) for x,y,z in os.walk(directory)\
if extension: << SYNTAX ERROR!
for i in z if i.endswith(extension)]:print x
--
Bob Gailer
Chapel Hill NC
919-636-4239
__
def myfiles(directory,extension=None):
for x in [os.path.join(x,i) for x,y,z in os.walk(directory)\
if extension:
for i in z if i.endswith(extension)]:print x
Dj Gilcrease
OpenRPG Developer
~~http://www.openrpg.com
___
Tutor maillist -
hello!I am a novice looking up to the tutor as my Guide.
I got a problem while using optional parameter.
#! user/bin/env python
import os
def myfiles(directory,extension=None):
for x in [os.path.join(x,i) for x,y,z in os.walk(directory)\
for i in z if i.endswith(extension)]:prin