• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python process.client函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中MonetDBtesting.process.client函数的典型用法代码示例。如果您正苦于以下问题:Python client函数的具体用法?Python client怎么用?Python client使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了client函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: client

def client(lang, file, user = 'monetdb', passwd = 'monetdb'):
    sys.stderr.write('#client\n')
    sys.stderr.flush()
    clt = process.client(lang, user = user, passwd = passwd,
                         stdin = open(file),
                         stdout = process.PIPE, stderr = process.PIPE)
    return clt.communicate()
开发者ID:MonetDB,项目名称:MonetDB,代码行数:7,代码来源:set_a_new_user_password.SF-1844050.py


示例2: client

def client(cmd, infile, user = 'monetdb', passwd = 'monetdb'):
    clt = process.client(cmd, user = user, passwd = passwd,
                         stdin = open(infile), stdout = process.PIPE,
                         stderr = process.PIPE)
    out, err = clt.communicate()
    sys.stdout.write(out)
    sys.stderr.write(err)
开发者ID:MonetDB,项目名称:MonetDB,代码行数:7,代码来源:Dependencies.SQL.py


示例3: client

def client(file, user, passwd):
    sys.stdout.flush()
    sys.stderr.flush()
    c = process.client(lang = 'sql',
                       user = user, passwd = passwd,
                       args = [os.path.join(d, os.pardir, file)],
                       log = True)
    c.communicate()
开发者ID:MonetDB,项目名称:MonetDB,代码行数:8,代码来源:VOC.SQL.py


示例4: client

def client(lang, user = 'monetdb', passwd = 'monetdb', input = None):
    clt = process.client(lang, user = user, passwd = passwd,
                         stdin = process.PIPE,
                         stdout = process.PIPE,
                         stderr = process.PIPE)
    out, err = clt.communicate(input)
    sys.stdout.write(out)
    sys.stderr.write(err)
开发者ID:MonetDB,项目名称:MonetDB,代码行数:8,代码来源:create.SQL.py


示例5: client

def client(input):
    c = process.client('sql',
                         stdin = process.PIPE,
                         stdout = process.PIPE,
                         stderr = process.PIPE)
    out, err = c.communicate(input)
    sys.stdout.write(out)
    sys.stderr.write(err)
开发者ID:jaiminpan,项目名称:Monetdb,代码行数:8,代码来源:alastair_udf_mergetable_bug.py


示例6: main

def main():
    sys.stderr.write('#client\n')
    sys.stderr.flush()
    clt = process.client('sql', user = 'monetdb', passwd = 'monetdb',
                         stdin = process.PIPE,
                         stdout = process.PIPE, stderr = process.PIPE)
    currenttime = time.strftime('%H:%M:%S', time.localtime(time.time()))
    #SQL command for checking the localtime
    sqlcommand = "select localtime() between (time '%s' - interval '20' second) and (time '%s' + interval '20' second);" % (currenttime, currenttime)
    out, err = clt.communicate(sqlcommand)
    sys.stdout.write(out)
    sys.stderr.write(err)
开发者ID:cswxu,项目名称:monetdb-mcs,代码行数:12,代码来源:currenttime.Bug-2781.SQL.py


示例7: client

def client(x,s, c, file):
    sys.stdout.write('\nserver %d%d, client %d\n' % (x,s,c))
    sys.stderr.write('\nserver %d%d, client %d\n' % (x,s,c))
    sys.stderr.flush()
    sys.stderr.write('#client%d\n' % x)
    sys.stdout.flush()
    sys.stderr.flush()
    clt = process.client('sql', stdin = process.PIPE,
                         stdout = process.PIPE, stderr = process.PIPE)
    port = int(os.getenv('MAPIPORT', '50000'))
    client_load_file(clt, port, file)
    return clt.communicate()
开发者ID:cswxu,项目名称:monetdb-mcs,代码行数:12,代码来源:connections.py


示例8: client

def client(cmd, infile = None):
    if infile is not None:
        f = open(infile)
    else:
        f = None
    clt = process.client(cmd, stdin = f,
                         stdout = process.PIPE, stderr = process.PIPE,
                         log = True)
    if f is not None:
        f.close()
    out, err = clt.communicate()
    sys.stdout.write(out)
    sys.stderr.write(err)
开发者ID:MonetDB,项目名称:MonetDB,代码行数:13,代码来源:MapiClient-dump.SF-905851.SQL.py


示例9: main

def main():
    if time.daylight and time.gmtime(time.time()).tm_isdst:
        zone = time.altzone
    else:
        zone = time.timezone
    sys.stderr.write('#client\n')
    sys.stderr.flush()
    clt = process.client('sql', user = 'monetdb', passwd = 'monetdb',
                         stdin = process.PIPE,
                         stdout = process.PIPE, stderr = process.PIPE)
    currenttime = time.strftime('%H:%M:%S', time.localtime(time.time()))
    #SQL command for checking the localtime
    sqlcommand = "select localtime() between (time '%s' - interval '20' second) and (time '%s' + interval '20' second);" % (currenttime, currenttime)
    out, err = clt.communicate(sqlcommand)
    sys.stdout.write(out)
    sys.stderr.write(err)
    clt = process.client('sql', user = 'monetdb', passwd = 'monetdb',
                         stdin = process.PIPE,
                         stdout = process.PIPE, stderr = process.PIPE)
    out, err = clt.communicate('select localtime();')
    sys.stdout.write('#Python says: %s; current time zone %d\n' % (currenttime, zone))
    for line in out.split('\n'):
        if line:
            sys.stdout.write('#MonetDB says: %s\n' % line)
开发者ID:MonetDB,项目名称:MonetDB,代码行数:24,代码来源:currenttime.Bug-2781.SQL.py


示例10: bug3261

import sys
try:
    from MonetDBtesting import process
except ImportError:
    import process

c = process.client('sql', stdin = process.PIPE,
                   stdout = process.PIPE, stderr = process.PIPE,
                   # these two to make client/server communication
                   # more efficient:
                   interactive = False, echo = False)
q = []
q.append(("create table bug3261 (probeid int, markername varchar(64));\n"
          "copy %d records into bug3261 from stdin using delimiters "
          "'\\t','\\n','' null as 'null';\n") % (1455 * 3916))
for i in xrange(1,1456):
    v = 'rmm%d' % i
    for j in xrange(3916):
        q.append('%d\t%s\n' % (j, v))
out, err = c.communicate(''.join(q))
sys.stdout.write(out)
sys.stderr.write(err)
c = process.client('sql', stdin = process.PIPE, stdout = process.PIPE, stderr = process.PIPE)
out, err = c.communicate('select * from bug3261 where probeid = 1234 limit 10;\n')
sys.stdout.write(out)
sys.stderr.write(err)
c = process.client('sql', stdin = process.PIPE, stdout = process.PIPE, stderr = process.PIPE)
out, err = c.communicate('drop table bug3261;\n')
sys.stdout.write(out)
sys.stderr.write(err)
开发者ID:cswxu,项目名称:monetdb-mcs,代码行数:30,代码来源:empty-strings.Bug-3261.SQL.py


示例11: float

import sys
import re
try:
    from MonetDBtesting import process
except ImportError:
    import process

p = process.client('sqldump', stdout = process.PIPE, stderr = process.PIPE)
out, err = p.communicate()

pos = 0
for res in re.finditer(r'\b\d+\.\d{8,}\b', out):
    sys.stdout.write(out[pos:res.start(0)])
    sys.stdout.write('%.8g' % float(res.group(0)))
    pos = res.end(0)
sys.stdout.write(out[pos:])
sys.stderr.write(err)
开发者ID:cswxu,项目名称:monetdb-mcs,代码行数:17,代码来源:dump.SQL.py


示例12: client

def client(args, universal_newlines = True):
    clt = process.client('sql', args = args,
                         stdout = process.PIPE, stderr = process.PIPE,
                         universal_newlines = universal_newlines)
    return clt.communicate()
开发者ID:MonetDB,项目名称:MonetDB,代码行数:5,代码来源:utf8test.SQL.py


示例13: TempTable

import os, sys
try:
    from MonetDBtesting import process
except ImportError:
    import process

c = process.client('sql',
                   args = ['-s', '''CREATE USER "testuser" WITH PASSWORD \'password\' NAME \'Test User\' SCHEMA "sys";''' ],
                   stdout = process.PIPE,
                   stderr = process.PIPE)
out, err = c.communicate()
if out:
    sys.stdout.write(out)
if err:
    sys.stderr.write(err)

c = process.client('sql',
                   args = ['-s', 'CREATE GLOBAL TEMPORARY TABLE TempTable (i int);' ],
                   user = 'testuser', passwd = 'password',
                   stdout = process.PIPE,
                   stderr = process.PIPE)
out, err = c.communicate()
if out:
    sys.stdout.write(out)
if err:
    sys.stderr.write(err)

c = process.client('sql',
                   args = ['-s', 'CREATE LOCAL TEMPORARY TABLE TempTable (i int); '],
                   user = 'testuser', passwd = 'password',
                   stdout = process.PIPE,
开发者ID:MonetDB,项目名称:MonetDB,代码行数:31,代码来源:user_create_temp_table.Bug-2916.SQL.py


示例14: open

import os, sys
try:
    from MonetDBtesting import process
except ImportError:
    import process

c = process.client('sql',
                   stdin = open(os.path.join(os.getenv('TSTSRCDIR'),
                                             os.path.pardir,
                                             'dumping_tables.SF-2776908.sql')),
                   stdout = process.PIPE, stderr = process.PIPE,
                   log = True)
out, err = c.communicate()
sys.stdout.write(out)
sys.stderr.write(err)
开发者ID:MonetDB,项目名称:MonetDB,代码行数:15,代码来源:dumping_tables.SF-2776908.SQL.py


示例15: client

def client(file):
    sys.stderr.write('#client\n')
    sys.stderr.flush()
    clt = process.client('sql', stdin = open(file),
                         stdout = process.PIPE, stderr = process.PIPE)
    return clt.communicate()
开发者ID:MonetDB,项目名称:MonetDB,代码行数:6,代码来源:set_sql_debug_64__breaking_the_DB.SF-1906287.py


示例16: GRANTs

###
# Use functions that contain SELECT. INSERT, UPDATE, DELETE
# on a table for which the USER has GRANTs (possible).
###

import os, sys
try:
    from MonetDBtesting import process
except ImportError:
    import process

clt = process.client('sql', user = 'my_user', passwd = 'p1',
                     stdin = open(os.path.join(os.getenv('RELSRCDIR'), os.pardir, 'test_privs2.sql')),
                     stdout = process.PIPE, stderr = process.PIPE)
out, err = clt.communicate()
sys.stdout.write(out)
sys.stderr.write(err)
开发者ID:MonetDB,项目名称:MonetDB,代码行数:17,代码来源:test_privs2_p1.SQL.py


示例17: run

 def run(self):
     for i in range(NITER):
         c = process.client('sql', stdin = process.PIPE, stdout = process.PIPE, stderr = process.PIPE)
         out, err = c.communicate(self.query)
开发者ID:MonetDB,项目名称:MonetDB,代码行数:4,代码来源:concurrent-queries.Bug-3848.SQL.py


示例18: numeric

import os, sys
try:
    from MonetDBtesting import process
except ImportError:
    import process

n = 100000000
clt = process.client('sql',
                     stdin = process.PIPE,
                     stdout = process.PIPE,
                     stderr = process.PIPE,
                     interactive = False,
                     echo = False)
clt.stdin.write('start transaction;\n')
clt.stdin.write('create table n8 (a numeric(14,2));\n')
clt.stdin.write('copy %d records into n8 from stdin;\n' % n)
s = '1.21\n' * 1000
for i in xrange(n / 1000):
    clt.stdin.write(s)
clt.stdin.write("select 'avg(sqrt(n8)) == 1.1', avg(sqrt(a)) from n8;\n")
clt.stdin.write('rollback;\n')
out, err = clt.communicate()
sys.stdout.write(out)
sys.stderr.write(err)
开发者ID:cswxu,项目名称:monetdb-mcs,代码行数:24,代码来源:AVG_of_SQRT.SF-2757642.SQL.py


示例19: print

    from MonetDBtesting import process
except ImportError:
    import process
import os, sys

dbfarm = os.getenv('GDK_DBFARM')
tstdb = os.getenv('TSTDB')

if not tstdb or not dbfarm:
    print('No TSTDB or GDK_DBFARM in environment')
    sys.exit(1)

dbname = tstdb

s = process.server(dbname = dbname, stdin = process.PIPE, stdout = process.PIPE, stderr = process.PIPE)

c = process.client('sql', server = s, stdin = process.PIPE, stdout = process.PIPE, stderr = process.PIPE)

cout, cerr = c.communicate('''\
update tmp set i = 3 where i = 1;
update tmp set s = 'blah';
select * from tmp;
''')

sout, serr = s.communicate()

sys.stdout.write(sout)
sys.stdout.write(cout)
sys.stderr.write(serr)
sys.stderr.write(cerr)
开发者ID:MonetDB,项目名称:MonetDB,代码行数:30,代码来源:wlc30.py


示例20:

import os, sys
try:
    from MonetDBtesting import process
except ImportError:
    import process

c = process.client('sql',
                   args = [os.path.join(os.getenv('TSTSRCBASE'),
                                        os.getenv('TSTDIR'),
                                        'like_tests.sql')],
                   stdout = process.PIPE, stderr = process.PIPE)
out, err = c.communicate()
sys.stdout.write(out)
sys.stderr.write(err)
开发者ID:MonetDB,项目名称:MonetDB,代码行数:14,代码来源:like_tests.SQL.py



注:本文中的MonetDBtesting.process.client函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap