본문 바로가기 메뉴 바로가기

Hello, Python

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Hello, Python

검색하기 폼
  • 분류 전체보기 (146)
    • Python (87)
      • tkinter (12)
    • Java (6)
      • Spring (1)
      • JPA (3)
    • MySQL (2)
    • Linux (19)
    • Virtualization (1)
    • Infra (1)
    • Network (1)
    • VBA(Excel) (19)
    • Apache (3)
    • html (1)
    • Windows (2)
    • 일상다반사 (2)
  • 방명록

입출력 (1)
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
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • highlightthickness
  • fetch join
  • 리눅스
  • Python
  • highlightbackground
  • Excel
  • checkbutton
  • FetchType
  • vba
  • Composite Key
  • JPA
  • IdClass
  • disabledforeground
  • 파이썬
  • borderwidth
  • tkinter
  • onetomany
  • Java
  • activebackground
  • 상수
  • 폼
  • indicatoron
  • Module
  • activeforeground
  • tkinter command & bind [명령어묶기와 사건묶기] Python
  • Private
  • command
  • apache
  • ManyToOne
  • Linux
more
«   2025/05   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바