• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

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/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/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/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

src/g/i/gistore-0.1.6/lib/gistore/scm/git.py   gistore(Download)
# GNU General Public License for more details.
#
 
from subprocess import Popen, PIPE, STDOUT
import os
import re
 
    def init(self):
        if self.is_repos():
            verbose("Repos %s already exists." % self.root, LOG_WARNING)
            return False
        args = ["git", "init"]
        verbose(" ".join(args), LOG_DEBUG)
        proc = Popen(args, stdout=PIPE, stderr=STDOUT, close_fds=True)
    def commit(self, message="no message"):
        self._abort_if_not_repos()
        assert os.path.realpath(os.getcwd()) == self.root
        args = ["git", "add", "."]
        verbose(" ".join(args), LOG_DEBUG)
        proc_add = Popen(args, stdout=PIPE, stderr=STDOUT, close_fds=True)
        exception_if_error(proc_add, args)
 
        args = ["git", "ls-files", "--deleted"]
        verbose(" ".join(args), LOG_DEBUG)
        proc_ls = Popen(args, stdout=PIPE, stderr=STDOUT, close_fds=True)
                    flagfile=os.path.join(os.path.dirname(file), ".gistore-keep-empty")
                    os.mknod(flagfile, 0644)
                args = ["git", "rm", "--quiet", file]
                proc_rm = Popen(args, stdout=PIPE, stderr=STDOUT, close_fds=True)
                warn_if_error(proc_rm, args)
                if flagfile:
                    os.unlink(flagfile)
 
        args = ["git", "commit", "--quiet", "-m", message]
        verbose(" ".join(args), LOG_DEBUG)
        proc_ci = Popen(args, stdout=PIPE, stderr=STDOUT, close_fds=True)
        # If nothing to commit, git commit return 1.
        exception_if_error2(proc_ci, args, test=lambda n: n.startswith("nothing to commit"))
 
    def post_check(self):
        submodules = []
        args = ["git", "submodule", "status", self.root]
        proc = Popen(args, stdout=PIPE, stderr=STDOUT, close_fds=True)

src/p/y/pywii-HEAD/Python-3.1.2/Tools/ssl/get-remote-certificate.py   pywii(Download)
    def subproc(cmd):
        from subprocess import Popen, PIPE, STDOUT
        proc = Popen(cmd, stdout=PIPE, stderr=STDOUT, shell=True)
        status = proc.wait()
        output = proc.stdout.read()
        return status, output
 

src/s/t/stackless-HEAD/Tools/ssl/get-remote-certificate.py   stackless(Download)
    def subproc(cmd):
        from subprocess import Popen, PIPE, STDOUT
        proc = Popen(cmd, stdout=PIPE, stderr=STDOUT, shell=True)
        status = proc.wait()
        output = proc.stdout.read()
        return status, output
 

src/a/t/Athena-Dependencies-Python-HEAD/Tools/ssl/get-remote-certificate.py   Athena-Dependencies-Python(Download)
    def subproc(cmd):
        from subprocess import Popen, PIPE, STDOUT
        proc = Popen(cmd, stdout=PIPE, stderr=STDOUT, shell=True)
        status = proc.wait()
        output = proc.stdout.read()
        return status, output
 

src/u/n/unladen-swallow-HEAD/Tools/ssl/get-remote-certificate.py   unladen-swallow(Download)
    def subproc(cmd):
        from subprocess import Popen, PIPE, STDOUT
        proc = Popen(cmd, stdout=PIPE, stderr=STDOUT, shell=True)
        status = proc.wait()
        output = proc.stdout.read()
        return status, output
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next