Skip to content

boxysean/pylateral

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pylateral

Intuitive multi-threaded task processing in python.

Example

import urllib.request

@pylateral.task
def request_and_print(url):
    response = urllib.request.urlopen(url)
    print(response.read())
    
URLS = [
    "https://www.nytimes.com/",
    "https://www.cnn.com/",
    "https://europe.wsj.com/",
    "https://www.bbc.co.uk/",
    "https://some-made-up-domain.com/",
]

with pylateral.task_pool():
    for url in URLS:
        request_and_print(url)

print("Complete!")