Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)| #!/usr/bin/env swift | |
| // | |
| // PrintBootCampESDInfo.swift | |
| // | |
| // Created by nuomi1 on 8/5/18. | |
| // Copyright © 2018年 nuomi1. All rights reserved. | |
| // | |
| import Foundation |
| # | |
| # UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs | |
| # just run "sudo trimforce enable" to activate the trim support from now on! | |
| # | |
| # Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/) | |
| # Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/ | |
| # | |
| # Looks for "Apple" string in HD kext, changes it to a wildcard match for anything | |
| # | |
| # Alternative to http://www.groths.org/trim-enabler-3-0-released/ |
Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)| # Object-oriented API | |
| # | |
| # Memory usage (iteration, object count, memory size) | |
| # 100 5637 1562216 | |
| # 200 5529 1491528 | |
| # 300 5422 1426264 | |
| # 400 5758 1587376 | |
| # 500 5422 1426288 | |
| # 600 5416 1440456 | |
| # 700 5610 1515056 |