src/p/y/PyNN-0.6.0/test/test_examples_mpi.py PyNN(Download)
""" Test that running a distributed simulation using MPI gives the same results as a local, serial simulation. """ import os from subprocess import Popen, PIPE, STDOUT
script_args)
print cmd1
print cmd2
job1 = Popen(cmd1, stdin=None, stdout=None, stderr=STDOUT, shell=True, cwd=tmpdirs['serial'])
job2 = Popen(cmd2, stdin=None, stdout=None, stderr=STDOUT, shell=True, cwd=tmpdirs['distrib'])
job2.wait()
job1.wait()
for mode in 'serial', 'distrib':
for filename in filename_maps[mode].values():
cmd = "sort %s > %s,sorted" % (filename, filename)
jobs.append(Popen(cmd, shell=True))
for job in jobs:
job.wait()
src/p/y/pyobjc-core-2.3/Examples/NonFunctional/RemotePyInterpreter/test_client.py pyobjc-core(Download)
try:
import fcntl
except:
fcntl = None
import os
import sys
from subprocess import Popen, PIPE
def open_connection(executable=sys.executable):
serversock = bind_and_listen(('127.0.0.1', 0))
hostport = serversock.getsockname()
proc = Popen([executable, 'tcpinterpreter.py', repr(hostport)], stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
clientsock, address = serversock.accept()
serversock.shutdown(2)
return clientsock, proc
src/p/y/PyNN-0.6.0/test/test_examples.py PyNN(Download)
else:
logging.error('Invalid simulation engine "%s". Valid values are "nest", "pcsim", "neuron", "brian"' % engine)
p = subprocess.Popen(cmd, shell=True, stdout=logfile, stderr=subprocess.PIPE, close_fds=True)
p.wait()
logfile.close()
errorMsg = p.stderr.read()
src/k/i/kiwi-gtk-1.9.23/examples/tasklet/test-tasklet2.py kiwi-gtk(Download)
win.show()
## launch process
proc = subprocess.Popen(args[0], shell=True, stdout=subprocess.PIPE,
bufsize=1, close_fds=True)
win.set_title("%s (running)" % args[0])
#print proc.stdout, type(proc.stdout), dir(proc.stdout)
src/m/a/matplotlib-HEAD/py4science/examples/sphinx_template2/tools/sphinxext/inheritance_diagram.py matplotlib(Download)
installation-related errors that may occur.
"""
try:
dot = subprocess.Popen(['dot'] + list(args),
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
close_fds=True)
except OSError:
src/m/a/matplotlib-HEAD/py4science/examples/sphinx_template/sphinxext/inheritance_diagram.py matplotlib(Download)
installation-related errors that may occur.
"""
try:
dot = subprocess.Popen(['dot'] + list(args),
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
close_fds=True)
except OSError:
src/m/a/matplotlib-HEAD/sampledoc_tut/sphinxext/inheritance_diagram.py matplotlib(Download)
installation-related errors that may occur.
"""
try:
dot = subprocess.Popen(['dot'] + list(args),
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
close_fds=True)
except OSError:
src/b/e/Bento-HEAD/check_examples.py Bento(Download)
def test_package(d):
for cmd in ["configure", "build"]:
cmd = [bentomaker, "configure"]
p = subprocess.Popen(cmd, cwd=test, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
p.wait()
if p.returncode:
print p.stdout.read()
src/g/e/gevent-0.13.1/examples/processes.py gevent(Download)
def popen_communicate(args, data=''):
"""Communicate with the process non-blockingly."""
p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
fcntl.fcntl(p.stdin, fcntl.F_SETFL, os.O_NONBLOCK) # make the file nonblocking
fcntl.fcntl(p.stdout, fcntl.F_SETFL, os.O_NONBLOCK) # make the file nonblocking
bytes_total = len(data)
src/p/y/python-ecore-0.7.1/examples/x/mplayer_embed.py python-ecore(Download)
#!/usr/bin/env python import sys import os import ecore import ecore.x from subprocess import Popen, PIPE
cmd = ["/usr/bin/mplayer", "-slave", "-nomouseinput", "-quiet",
"-wid", str(sub_window.xid), filename]
p = Popen(cmd, stdin=PIPE, stdout=PIPE, close_fds=True)
def handle_read(fd_handler, file):
line = file.read(1)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next