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
오현석
,
미샤 고렐릭
,
이안 오스발트
May 2021
Beginner to intermediate
528 pages
11h 27m
Korean
Hanbit Media, Inc.
Content preview from
고성능 파이썬(2판)
270
고성능 파이썬(2판)
8.2.1
순차적 크롤러
실험의 동시성을 제어하기 위해
URL
목록을 받아 각각에서 데이터를 가져온 후 각 웹 페이지
의 콘텐츠 길이를 합산하는 순차 웹 크롤러
(
혹은 스크래퍼
scraper
)
를 작성할 것이다.
name
과
delay
라는 두 매개변수를 받는
HTTP
서버를 사용하려 한다.
delay
필드는 응답하기 전에 서
버가 얼마나 오래 기다려야 하는지를 밀리초 단위로 나타내며,
name
필드는 단지 로그에 표시
하기 위해 사용하는 이름이다.
delay
매개변수를 제어하면 서버가 쿼리에 응답하는 데 걸리는 시간을 시뮬레이션할 수 있다.
현실에서는 느린 웹 서버, 처리하기 어려운 데이터베이스 호출, 오래 걸리는
I
/
O
호출이 이런
경우다. 순차적인 경우 이는 우리 프로그램이
I
/
O
대기 상태에 더 오래 머문다는 뜻이지만, 나
중에 다룰 동시성 예제에서는 프로그램이 다른 작업을 수행할 시간이 더 많아진다는 의미가
된다.
[예제
8
-
3
]에서는
requests
모듈을 사용해서
HTTP
호출을 한다. 단순한 모듈이기에 이를
선택했다. 이번 절에서
HTTP
를 사용하는 이유도
HTTP
가 간단하면서 상당히 쉽게 수행할 수
있는
I
/
O
이기 때문이다. 일반적으로
HTTP
라이브러리에 대한 요청은 다른 어떤 형태의
I
/
O
로든 바꿀 수 있다.
예제 ...
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
이펙티브 타입스크립트
Dan Vanderkam
전문가를 위한 파이썬(2판)
루시아누 하말류
엑셀이 편해지는 파이썬
펠릭스 춤슈타인
핸즈온 비지도 학습
강재원, 권재철, 안쿠르 A. 파텔
Publisher Resources
ISBN: 9791162244210