Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- port
- node.js
- urllib
- pandas
- 날짜
- IOS
- Excel
- ubuntu
- 유니티
- 맛집
- swift
- 리눅스
- 함수
- GIT
- mssql
- 다이어트
- Unity
- Linux
- tensorflow
- 라즈베리파이
- flutter
- ASP
- MySQL
- python
- PyQt5
- javascript
- MS-SQL
- PyQt
- PER
- sqlite
Archives
목록print] (1)
아미(아름다운미소)
[python]print를 로그파일로 생성하기
python print를 로그파일로 생성하기 import sys class Tee(object): def __init__(self, *files): self.files = files def write(self, obj): for f in self.files: f.write(obj.encode('utf-8')) if __name__ == "__main__": f = open('logfile.txt', 'w') original = sys.stdout sys.stdout = Tee(sys.stdout, f) print "test~" # This will go to stdout and the file out.txt #use the original sys.stdout = original print "Test lo..
랭귀지/python
2018. 11. 18. 11:30