본문 바로가기

Python

python multiprocessing AttributeError

python multiprocessing AttributeError


stackoverflow를 참조했다

자꾸 AttributeError: Can't get attribute 'f' on <module '__main__' (built-in)> 식의 오류가 떠서 대체 무슨 일이 일어나는지 알아봤다.

결론은 children이 해당 모듈을 import 가능해야 한다는 것.
children 프로세스는 자기를 만든 부모 프로세스의 코드에 있는 변수나 함수를 from ~ import 형태로 가져오기 때문이다.

'Python' 카테고리의 다른 글

Python JSON  (0) 2016.02.09
python multiprocessing  (0) 2016.02.09
os.path 사용하기  (0) 2016.01.13
메일 발송  (0) 2015.12.08
Random  (0) 2015.12.08