All Samples(216) | Call(0) | Derive(0) | Import(216)
int(x[, base]) -> integer Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.
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/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()
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/pyfsevents-0.2b1/examples/testwatcher.py pyfsevents(Download)
cmd = "python -u watcher.py %s" % tmpdir
child = subprocess.Popen(cmd,
shell=True, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
time.sleep(2)
os.chdir(tmpdir)
src/b/e/bestgui-HEAD/bestgui/trunk/bestgui/subprocess2.py bestgui(Download)
from subprocess import list2cmdline
try:
from subprocess import PIPE, STDOUT, call, check_call, CalledProcessError
__all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call",
"CalledProcessError"]
except ImportError:
# @COMPATIBILITY with python 2.4
from subprocess import PIPE, STDOUT, call
src/d/i/dispcalgui-HEAD/trunk/dispcalGUI/worker.py dispcalgui(Download)
else: startupinfo = None p = sp.Popen([cmd.encode(fs_enc)], stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.STDOUT, startupinfo=startupinfo) for i, line in enumerate((p.communicate()[0] or "").splitlines()): if isinstance(line, basestring): line = line.strip()
startupinfo = None if not interact: if silent: stderr = sp.STDOUT else: stderr = tempfile.SpooledTemporaryFile() if capture_output:
self.subprocess = WPopen(" ".join(cmdline) if shell else
cmdline, stdin=sp.PIPE,
stdout=tempfile.SpooledTemporaryFile(),
stderr=sp.STDOUT,
shell=shell, cwd=working_dir,
startupinfo=startupinfo)
else:
else:
startupinfo = None
p = sp.Popen([xicclu, '-ff', '-i' + ('a' if absolute else 'r'), '-p' + pcs, '-s100', "temp.icc"],
stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.STDOUT,
cwd=cwd.encode(fs_enc), startupinfo=startupinfo)
odata = p.communicate('\n'.join(idata))[0].splitlines()
if p.wait() != 0:
else:
startupinfo = None
p = sp.Popen([xicclu, '-fb', '-ir', '-pl', '-s100', "temp.icc"],
stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.STDOUT,
cwd=cwd.encode(fs_enc), startupinfo=startupinfo)
ogray = p.communicate('\n'.join(igray))[0].splitlines()
if p.wait() != 0:
else:
startupinfo = None
p = sp.Popen([xicclu, '-fb', '-ir', '-p' + pcs, '-s100', "temp.icc"],
stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.STDOUT,
cwd=cwd.encode(fs_enc), startupinfo=startupinfo)
odata = p.communicate('\n'.join(idata))[0].splitlines()
if p.wait() != 0:
src/d/i/dispcalgui-HEAD/dispcalGUI/worker.py dispcalgui(Download)
else: startupinfo = None p = sp.Popen([cmd.encode(fs_enc)], stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.STDOUT, startupinfo=startupinfo) for i, line in enumerate((p.communicate()[0] or "").splitlines()): if isinstance(line, basestring): line = line.strip()
startupinfo = None if not interact: if silent: stderr = sp.STDOUT else: stderr = tempfile.SpooledTemporaryFile() if capture_output:
self.subprocess = WPopen(" ".join(cmdline) if shell else
cmdline, stdin=sp.PIPE,
stdout=tempfile.SpooledTemporaryFile(),
stderr=sp.STDOUT,
shell=shell, cwd=working_dir,
startupinfo=startupinfo)
else:
else:
startupinfo = None
p = sp.Popen([xicclu, '-ff', '-ir', '-p' + pcs, '-s100', "temp.icc"],
stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.STDOUT,
cwd=cwd.encode(fs_enc), startupinfo=startupinfo)
odata = p.communicate('\n'.join(idata))[0].splitlines()
if p.wait() != 0:
else:
startupinfo = None
p = sp.Popen([xicclu, '-fb', '-ir', '-pl', '-s100', "temp.icc"],
stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.STDOUT,
cwd=cwd.encode(fs_enc), startupinfo=startupinfo)
ogray = p.communicate('\n'.join(igray))[0].splitlines()
if p.wait() != 0:
else:
startupinfo = None
p = sp.Popen([xicclu, '-fb', '-ir', '-p' + pcs, '-s100', "temp.icc"],
stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.STDOUT,
cwd=cwd.encode(fs_enc), startupinfo=startupinfo)
odata = p.communicate('\n'.join(idata))[0].splitlines()
if p.wait() != 0:
src/g/s/gsdview-HEAD/trunk/exectools/subprocess2.py gsdview(Download)
from subprocess import list2cmdline
try:
from subprocess import PIPE, STDOUT, call, check_call, CalledProcessError
__all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call",
"CalledProcessError"]
except ImportError:
# @COMPATIBILITY with python 2.4
from subprocess import PIPE, STDOUT, call
src/k/o/kokki-0.2/kokki/providers/package/easy_install.py kokki(Download)
import re
from subprocess import check_call, Popen, PIPE, STDOUT
from kokki.providers.package import PackageProvider
version_re = re.compile(r'\S\S(.*)\/(.*)-(.*)-py(.*).egg\S')
best_match_re = re.compile(r'Best match: (.*) (.*)\n')
class EasyInstallProvider(PackageProvider):
def get_current_status(self):
p = Popen(["python", "-c", "import %s; print %s.__path__" % (self.resource.package_name, self.resource.package_name)], stdout=PIPE, stderr=STDOUT)
def candidate_version(self):
if not hasattr(self, '_candidate_version'):
p = Popen([self.easy_install_binary_path, "-n", self.resource.package_name], stdout=PIPE, stderr=STDOUT)
out = p.communicate()[0]
res = p.wait()
if res != 0:
self.log.warning("easy_install check returned a non-zero result (%d) %s" % (res, self.resource))
def install_package(self, name, version):
check_call([self.easy_install_binary_path, "%s==%s" % (name, version)], stdout=PIPE, stderr=STDOUT)
def update_package(self, name, version):
self.install_package(name, version)
def remove_package(self, name, version):
src/g/s/gsdview-HEAD/exectools/subprocess2.py gsdview(Download)
from subprocess import list2cmdline
try:
from subprocess import PIPE, STDOUT, call, check_call, CalledProcessError
__all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call",
"CalledProcessError"]
except ImportError:
# @COMPATIBILITY with python 2.4
from subprocess import PIPE, STDOUT, call
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next