Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Tip
titleimport

import os

import sys

Code Block
languagepy
themeEmacs
title하위 디렉토리 전체 순회
def searchWarnCode(indir):
    for root, dirs, filenames in os.walk(indir):
        for f in filenames:
            fileExt = os.path.splitext(f)[1].replace('.','')
            if fileExt in extFilter:
                fileRead( root + '\\' + f ,fileExt)
Code Block
languagepy
themeEmacs
titlefile open
sf = open("testsrc.txt", "r")
context = sf.read()
Code Block
languagepy
themeEmacs
title특정 디렉토리 자동생성
workDir = os.getcwd()
logDir = workDir + '\\logs'
if not os.path.isdir(logDir):
os.mkdir(logDir)