Python, 파일 입출력
파일객체 = open(file,mode)file : 파일명mode : 파일을 열때의 모드를 의미하여, 다음의 문자열의 조합으로 사용가능r : 읽기 (Default)w : 쓰기a : 쓰기 + 이어쓰기+ : 읽기 + 쓰기b : 바이너리t : 텍스트 (Default)텍스트모드인 경우 유닉스에서는 newline이 '\n'으로 적용되며, 윈도우에서는 '\r\n'으로 적용됨파일로부터 읽고 쓰기 위해서는 read()함수와 문자열을 쓰는 write()함수가 제공됨파일을 열고 할일을 모두 완료했을경우 close()함수로 파일을 닫아줘야함>>> f = open('test.txt','w') #test.txt.파일을 쓰기모두 열었음>>> f.write('Python') #test.txt파일에 "Python"이라는 문자열을 기..
Python
2016. 4. 29. 12:50
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- JPA
- disabledforeground
- 리눅스
- highlightbackground
- command
- borderwidth
- apache
- tkinter
- Python
- indicatoron
- activebackground
- highlightthickness
- 폼
- fetch join
- Excel
- vba
- Composite Key
- 상수
- checkbutton
- Linux
- Private
- Java
- onetomany
- 파이썬
- FetchType
- activeforeground
- ManyToOne
- Module
- IdClass
- tkinter command & bind [명령어묶기와 사건묶기] Python
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함