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판)
676
4
부
제어 흐름
여기서
iter(
)
함수가
callable_iterator
를 반환함에 주의하라. 예제에서
for
루프는 아주
오래 실행될 수도 있지만, 절대
1
을 출력하지 않는다. 이 값은 센티넬값이기 때문이다. 일반적
인 반복자가 그렇듯, 예제에서의
d6_iter
객체는 일단 소모되고 나면 더는 사용할 수가 없다.
다시 반복하려면
iter(
)
를 한 번 더 호출해 반복자를 새로 만들어야 한다.
iter
()
에 대한 문서
(
https
://
fpy
.
li
/
17
-
3
)
에는 다음과 같은 설명과 예제 코드가 나온다.
iter()
의 두 번째 용법은 블록을 읽을 때 유용하게 사용된다. 예를 들어 이진 데이터베이스
에서 파일이 끝날 때까지 고정 폭 블록을 읽으려면 다음과 같이 작성할 수 있다.
from functools import partial
with open(‘mydata.db’, ‘rb’) as f:
read64 = partial(f.read, 64)
for block in iter(read64, b’’):
process_block(block)
원래 예제
(
https://fpy.li/17-3
)
에는 없지만, 코드를 깔끔하게 만들고자
read64
할당문
을 추가했다.
iter(
)
에 전달할 콜러블 객체는 인수를 요구하지 않아야 하므로
partial(
)
함
수가 필요하다. ...
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