noScriptFound = True
for dirEntry in sorted(os.listdir(cwd)):
- if os.path.isfile(dirEntry):
+ fullDirEntry = os.path.join(cwd, dirEntry)
+ if os.path.isfile(fullDirEntry):
if dirEntry != scriptName:
- fileName, fileExtension = os.path.splitext(dirEntry)
+ fileExtension = os.path.splitext(fullDirEntry)[1]
if fileExtension == '.py':
noScriptFound = False
- subprocess.call(["python", dirEntry])
+ subprocess.call(['python', fullDirEntry])
elif fileExtension == '.sh':
noScriptFound = False
- subprocess.call(["sh", dirEntry])
+ subprocess.call(['sh', fullDirEntry])
if noScriptFound == True:
print 'no scripts found...'