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/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/p/y/python-github2-HEAD/examples/friend-or-follow.py python-github2(Download)
import sys import optparse from subprocess import Popen, PIPE from github2.client import Github ITEM_FMT = "* %s (%s)"
def git_config_get(self, key):
pipe = Popen(["git", "config", "--get", key], stdout=PIPE)
return pipe.communicate()[0].strip()
@property
def followers(self):
if self._followers is None:
src/p/y/pygrace-HEAD/trunk/Examples/test.py pygrace(Download)
"""This module is a wrapper that runs the scripts that generate figures using PyFig. If errors occur, full Tracebacks of the errors are sent to standard out.""" from sys import stderr, stdout from subprocess import Popen, PIPE from os.path import sep, splitext
# try to make figure using pyfig script (execute in shell)
command = '%s %s' % (PYTHON_PATH, scriptPath)
childProcess = Popen(command, shell=True, stderr=PIPE)
# write output of error stream
errorOutput = childProcess.stderr.read()
src/p/y/pygrace-HEAD/Examples/test.py pygrace(Download)
"""This module is a wrapper that runs the scripts that generate figures using PyFig. If errors occur, full Tracebacks of the errors are sent to standard out.""" from sys import stderr, stdout from subprocess import Popen, PIPE from os.path import sep, splitext
# try to make figure using pyfig script (execute in shell)
command = '%s %s' % (PYTHON_PATH, scriptPath)
childProcess = Popen(command, shell=True, stderr=PIPE)
# write output of error stream
errorOutput = childProcess.stderr.read()
src/g/i/github2-0.1.3/examples/friend-or-follow.py github2(Download)
import sys import optparse from subprocess import Popen, PIPE from github2.client import Github ITEM_FMT = "* %s (%s)"
def git_config_get(self, key):
pipe = Popen(["git", "config", "--get", key], stdout=PIPE)
return pipe.communicate()[0].strip()
@property
def followers(self):
if self._followers is None:
src/w/x/wxOptParse-0.1.6/wxoptparse/makeSample.py wxOptParse(Download)
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- from subprocess import Popen, PIPE import re class MakeSample:
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/s/w/switzerland-HEAD/trunk/switzerland/client/TimeManager.py switzerland(Download)
#!/usr/bin/env python import sys from subprocess import Popen,PIPE import logging import traceback import platform
log.info("Looking for ntpd...")
try:
ntpdc = Popen("ntpdc", stdin=PIPE, stderr=PIPE, stdout=PIPE)
except:
log.info("Couldn't run ntpdc. Will try something else...")
log.debug(traceback.format_exc())
executable = "ntpdate"
# try bin/ntpdate if ntpdate doesn't work
try:
Popen(executable, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=False)
except:
executable = os.path.join("bin", "ntpdate")
try:
Popen(executable, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=False)
if platform.system() == "Windows":
cmd = [executable,"-b","-q",timeserver]
cmd = " ".join(cmd)
ntpdate = Popen(cmd, stdin=PIPE, stderr=PIPE, stdout=PIPE, shell=True)
else:
cmd = [executable,"-q",timeserver]
ntpdate = Popen(cmd, stdin=PIPE, stderr=PIPE, stdout=PIPE)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next