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)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)| # Copyright 2008-2009 WebDriver committers | |
| # Copyright 2008-2009 Google Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software |
| # Set up ssh-agent | |
| SSH_ENV="$HOME/.ssh/environment" | |
| function start_agent { | |
| echo "Initializing new SSH agent..." | |
| /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
| echo succeeded | |
| chmod 600 "${SSH_ENV}" | |
| . "${SSH_ENV}" > /dev/null | |
| /usr/bin/ssh-add; |
| " Usage: | |
| " Copy this file to your ~/.vim/autoload directory. | |
| " :edit oldfile | |
| " :new newfile | |
| " :call wdiff#highlight(2, 1) " wdiff#highlight(winnr1, winnr2) | |
| let s:save_cpo = &cpo | |
| set cpo&vim | |
| function wdiff#highlight(Awinnr, Bwinnr) |
| #!/usr/bin/env python | |
| # This code is licensed according to the main package that it depends on: | |
| # http://pypi.python.org/pypi/ssh | |
| # License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) | |
| # http://www.gnu.org/licenses/lgpl.html | |
| import sys, os, os.path | |
| import select | |
| import SocketServer |
| # Index | |
| --------------------------------------------------------------------- | |
| curl -XPUT http://localhost:9200/pictures/ -d ' | |
| { | |
| "settings": { | |
| "analysis": { | |
| "analyzer": { | |
| "index_analyzer": { | |
| "tokenizer": "standard", |
| // JavaScript Range Function | |
| // © 2006 Matthias Miller (originally written March 29, 2006) | |
| // © 2010-2011 Peter Hillerström (modified 20.10.2010) | |
| // Feel free to use it under the BSD license. | |
| // Version: 0.1 Matthias Miller (originally written March 29, 2006) | |
| // Version: 0.2 Peter Hillerström (modified October 20, 2010) | |
| // Version: 0.3 Peter Hillerström (rewritten on May 24, 2011) |
| So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear! | |
| Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy. | |
| * Off the top of my head * | |
| 1. Fork their repo on Github | |
| 2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it | |
| git remote add my-fork git@github...my-fork.git |
| import java.lang.Math.*; | |
| public class Progressbar { | |
| private int max; | |
| private int current; | |
| private String name; | |
| private long start; | |
| private long lastUpdate; | |
| public Progressbar(int max, String name) |