Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
전문가를 위한 파이썬(2판)
by
루시아누 하말류
,
강권학
November 2024
Beginner to intermediate
1064 pages
25h 21m
Korean
Hanbit Media, Inc.
Content preview from
전문가를 위한 파이썬(2판)
183
4
장
유니코드 텍스트와 바이트
TIP
UTF
-
8
-
SIG
에 관한 칼렙의 팁
이 책의 테크니컬 리뷰어 중 한 명인 칼렙 해팅
Caleb
Hattingh
은
UTF
-
8
파일을 읽을 때
UTF
-
8
-
SIG
코덱을 사
용할 것을 권장한다.
UTF
-
8
-
SIG
코덱은
BOM
이 있든 없든 파일을 제대로 읽고
BOM
자체는 반환하지 않
으므로 나쁘지 않다. 그러나 파일에 쓸 때 필자는 전반적인 호환성을 위해
UTF
-
8
코덱을 사용하기를 권장
한다. 예를 들어 유닉스 시스템에서 파이썬 스크립트가
#!/usr/bin/env python3
주석으로 시작하면 실
행 가능 파일로 만들 수 있다. 이 방법이 제대로 작동하려면 파일의 처음 두 바이트가
b’#!’
이어야 하는데,
BOM
이 들어가면 이 규칙이 깨진다.
BOM
이 필요한 애플리케이션의 데이터용 파일을 만든다면
UTF
-
8
-
SIG
를 사용해야 하지만, 파이썬 코덱 문서(
https://fpy.li/4-9
)에서는 ‘
UTF
-
8
에서는
BOM
사용을 권
장하지 않으며, 일반적으로 피해야 한다’고 명시한다.
이제 파이썬
3
에서 텍스트 파일을 다루는 방법을 알아보자.
4
.
6
텍스트 파일 다루기
텍스트
I
/
O
를 처리하는 가장 훌륭한 방법은 ‘유니코드 샌드위치’
(
그림
4
-
2
)
다.
7
이 말은
(파
일을 읽으려고 열 때 등
)
입력할 때
bytes
는 가능한 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
전문가를 위한 리액트
테자스 쿠마르
데이터로 전문가처럼 말하기
칼 올친
개발자를 위한 머신러닝&딥러닝
로런스 모로니
고성능 파이썬(2판)
오현석, 미샤 고렐릭, 이안 오스발트
Publisher Resources
ISBN: 9791169211772