• 회원가입
  • 로그인
  • 구글아이디로 로그인

[file] Python - writable() 메서드 ★ - 파일 쓰기 가능 체크. (= writable메서드 = 라이터블)

1626  
목차
  1. writable() 예제 - 파일 쓰기 가능 여부 체크
  2. writable() 정의
  3. writable() 구문

 

writable() 예제 - 파일 쓰기 가능 여부 체크

 

f = open("hz.txt", "a", encoding='UTF-8')

print(f.writable())

 

결과값: True

 

writable() 정의

 

파일에 쓰기 가능 여부 체크.

 


 

open() 함수로 파일 열 때, 'a' 나 'w' 옵션 사용 시 쓰기 가능. 

※ 'a' 옵션 : 추가. 추가할 파일 열기. ※ 파일 없으면 생성.

※ 'w' 옵션 : 쓰기. 쓰기 위해 파일 열기. ※ 파일 없으면 생성.

 

 

writable() 구문

 

file.writable()

 


[매개변수]

 

없음.

 


[반환값]

 

파일 쓰기 가능 O 경우, True 반환.

파일 쓰기 가능 X 경우, False 반환.

 



분류 제목
module Python - statistics.mode() 메서드 ★ - 최빈값 반환. (= mode메서드 = 모드)
module Python - statistics.pstdev() 메서드 -
module Python - statistics.stdev() 메서드 -
module Python - statistics.pvariance() 메서드 -
module Python - statistics.variance() 메서드 -
module Python - math 모듈 메서드・상수 종류 (※ 수학 모듈)
module Python - math.acos() 메서드 -
module Python - math.acosh() 메서드 -
module Python - math.asin() 메서드 -
module Python - math.asinh() 메서드 -
module Python - math.atan() 메서드 -
module Python - math.atan2() 메서드 -
module Python - math.atanh() 메서드 -
module Python - math.ceil() 메서드 ★ - 천장 반올림 (= 상위 정수로 반올림. = ceil메서드…
module Python - math.comb() 메서드 -
module Python - math.copysign() 메서드 -
module Python - math.cos() 메서드 -
module Python - math.cosh() 메서드 -
module Python - math.degrees() 메서드 -
module Python - math.dist() 메서드 -
19/24
목록
찾아주셔서 감사합니다. Since 2012