All Samples(929) | Call(0) | Derive(0) | Import(929)
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/p/y/py_examples-HEAD/pyqtwindow/pyqtwindow.py py_examples(Download)
def get_master_volume(self):
proc = subprocess.Popen('/usr/bin/amixer sget PCM', shell=True, stdout=subprocess.PIPE)
amixer_stdout = proc.communicate()[0].split('\n')[5]
proc.wait()
find_start = amixer_stdout.find('[') + 1
find_end = amixer_stdout.find('%]', find_start)
def __update_master_volume(self, widget):
val = self.mySlider.value()
proc = subprocess.Popen('/usr/bin/amixer sset PCM ' + str(val) + '%', shell=True, stdout=subprocess.PIPE)
proc.wait()
def copy_to_all(self):
proc = subprocess.Popen('/usr/bin/xsendkeys Alt_L+v', shell=True, stdout=subprocess.PIPE)
proc.wait()
def __change_to_workspace_1(self):
proc = subprocess.Popen('/usr/bin/xsendkeys Alt_L+1', shell=True, stdout=subprocess.PIPE)
def __change_to_workspace_2(self):
proc = subprocess.Popen('/usr/bin/xsendkeys Alt_L+2', shell=True, stdout=subprocess.PIPE)
proc.wait()
def __change_to_workspace_3(self):
proc = subprocess.Popen('/usr/bin/xsendkeys Alt_L+3', shell=True, stdout=subprocess.PIPE)
proc.wait()
def __change_to_workspace_4(self):
proc = subprocess.Popen('/usr/bin/xsendkeys Alt_L+4', shell=True, stdout=subprocess.PIPE)
src/m/a/matplotlib-HEAD/py4science/examples/sphinx_template2/tools/sphinxext/inheritance_diagram.py matplotlib(Download)
"""
try:
dot = subprocess.Popen(['dot'] + list(args),
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
close_fds=True)
except OSError:
raise DotException("Could not execute 'dot'. Are you sure you have 'graphviz' installed?")
src/m/a/matplotlib-HEAD/py4science/examples/sphinx_template/sphinxext/inheritance_diagram.py matplotlib(Download)
"""
try:
dot = subprocess.Popen(['dot'] + list(args),
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
close_fds=True)
except OSError:
raise DotException("Could not execute 'dot'. Are you sure you have 'graphviz' installed?")
src/m/a/matplotlib-HEAD/sampledoc_tut/sphinxext/inheritance_diagram.py matplotlib(Download)
"""
try:
dot = subprocess.Popen(['dot'] + list(args),
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
close_fds=True)
except OSError:
raise DotException("Could not execute 'dot'. Are you sure you have 'graphviz' installed?")
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/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/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)
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
src/f/l/flocking-HEAD/flocking/measure/sampler.py flocking(Download)
def __call__(self, flock, flockstep, fast = True):
exe = os.path.abspath(os.path.dirname(__file__) + '/../C/bin/alpha.exe')
hull = subprocess.Popen('', executable = exe, stdin = subprocess.PIPE, stdout = subprocess.PIPE)
hull.communicate
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next