This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

ThreadIO, is good for capture stdout at multi-thread environment.

>>> # standard capture
>>> from threadio import print_to_file
>>> with print_to_file(TextIO()) as fp:
...     print("hello world")
>>> fp.getvalue()
'hello world\n'
>>> # standard capture (but not stdout, stderr)
>>> from threadio import ThreadIO
>>> fp = ThreadIO(TextIO())
>>> with fp.capture(TextIO()) as fp2:
...     print("hello world", file=fp)
...     with fp.capture(TextIO()) as fp3:
...         print("hello world3", file=fp)
...         # not captured fp3, stored fp2
...         print("fail captured", file=fp2)
>>> fp.getvalue()
>>> fp2.getvalue()
'hello world\nfail captured\n'
>>> fp3.getvalue()
'hello world3\n'
>>> # thread example
>>> from threading import Thread
>>> from threadio import print_to_file
>>> th = Thread(target=print, args=("hello world!",))
>>> with print_to_file(TextIO()) as fp:
...     th.start()
...     th.join()
...     print("HAYO!")
hello world!
>>> fp.getvalue() # not capture other thread's print
>>> # note. print_to_xxx function change everything.
>>> a = sys.stdout
>>> with print_to_file(TextIO()): pass
>>> b = sys.stdout
>>> a is b
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
threadio-0.1.tar.gz (2.2 kB) Copy SHA256 Checksum SHA256 Source Dec 14, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting