当前位置: 首页>>代码示例>>Python>>正文


Python threading._start_new_thread函数代码示例

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


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

示例1: start_thread

	def start_thread(self, lock=None):
		assert lock or self.lock
		if lock: self.lock = lock
		if self.ready:
			threading._start_new_thread( self.loop, () )
		else:
			print('Warning: no webcam found')
开发者ID:Stallion12,项目名称:pyppet,代码行数:7,代码来源:Webcam.py

示例2: __init__

 def __init__(self, address, listenerport):
     self.listener, self.listenerAddress = None, None
     self.listenerBase = socket.socket()
     self.listenerBase.bind((address, listenerport))
     self.listenerBase.listen(1)
     self.sender = socket.socket()
     threading._start_new_thread(self.THREAD_connectionscatcher, ())
开发者ID:leoniduvk,项目名称:communicator-alpha,代码行数:7,代码来源:ClientClass.py

示例3: main

def main():

    print('knock knock')
    a = input('')
    print('Interrupting cow.')
    threading._start_new_thread(interrupt, (3,))
    b = input('')
开发者ID:gothandy,项目名称:ingenuity,代码行数:7,代码来源:knockknock.py

示例4: card_shuffle

def card_shuffle():
    global card
    random.shuffle(card)
    set_filename("card_shuffle")
    threading._start_new_thread(play_sound,())
    print ("\n카드를 섞는 중입니다...\n")
    print ("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n")
开发者ID:leeinwoo,项目名称:PiSTOP,代码行数:7,代码来源:PiSTOP_Main.py

示例5: login_danmu_server

    def login_danmu_server(self, is_all_danmu = False):

        if self.__gid == None:
            if not self.login_danmu_auth_server():
                print('Login danmu auth server failed')
                return False

        login_info = self.__douyu_login_client.get_login_info()

        self.__recv_danmu_socket.connect(danmu_client.__address_danmu_1)

        login_data = '[email protected]=loginreq/[email protected]=' + login_info['acf_username'] + '/[email protected]=1234567890123456/[email protected]=' + self.__room_id

        self.__send_msg(login_data, self.__recv_danmu_socket)

        recv_data = self.__get_next_data(self.__recv_danmu_socket)
        parse_result = self.__parse_recv_msg(recv_data)
        if 'type' in parse_result and parse_result['type'] == 'loginres':
            if is_all_danmu:
                join_group = '[email protected]=joingroup/[email protected]=' + self.__room_id + '/[email protected]=' + '-9999'
            else:
                join_group = '[email protected]=joingroup/[email protected]=' + self.__room_id + '/[email protected]=' + self.__gid

            self.__send_msg(join_group, self.__recv_danmu_socket)
            threading._start_new_thread(self.__recv_socket_keep_alive, ())
开发者ID:xiaowei0828,项目名称:dota2_data_analyse,代码行数:25,代码来源:douyu_danmu.py

示例6: jdpay_wap

def jdpay_wap():
    env_name, root_url, live_key, app_id = datagen.get_current_env()
    url = "{0}/v1/charges".format(root_url)

    # request body
    charge = Model.ChargeBase.ChargeDict
    charge['order_no'] = random_str(10)
    charge['subject'] = 'TestOrder4jdpay_wap'
    charge['body'] = 'appletest4Pay'
    charge['amount'] = 10
    charge['channel'] = 'jdpay_wap'
    charge['currency'] = 'cny'
    charge['client_ip'] = '127.0.0.1'
    id = [('id', app_id)]
    extra = [("success_url", "http://pingxx.com"), ("fail_url", "htpps://pingxx.com")]
    charge['app'] = dict(id)
    charge['extra'] = dict(extra)

    mycharge = APIClient._http_call(url, "post", "json", "json", None, {"Authorization": "Bearer {0}".format(live_key)},
                                    30, **charge)
    print(mycharge)
    sshCmd.ssh_cmd("114.215.237.77", "56f27c2B", "echo "">/var/www/example/ziteng")
    threading._start_new_thread(sshCmd.ssh_cmd("114.215.237.77", "56f27c2B", "echo "">/var/www/example/ziteng"))
    time.sleep(5)
    Forward.forward_json(mycharge)
    ret = sshCmd.ssh_cmd("114.215.237.77", "56f27c2B", "echo "">/var/www/example/ziteng")

    print ret
    if int(filter(lambda x: x.isdigit(), ret)) > 1:
        print "The charge file had updated on %s" % ctime()
    else:
        print "forward the charge to update file again..."
        threading._start_new_thread(sshCmd.ssh_cmd("114.215.237.77", "56f27c2B", "echo "">/var/www/example/ziteng"))
        time.sleep(2)
        Forward.forward_json(mycharge)
开发者ID:hjonwy,项目名称:jjAuto,代码行数:35,代码来源:CreateCharge.py

示例7: start_threads

	def start_threads( self, lock ):
		if self.kinect.ready:
			threading._start_new_thread( self.kinect.loop, (lock,) )
			threading._start_new_thread( self.proc_contours.loop, (lock,) )
			#threading._start_new_thread( self.proc_shapes.loop, (lock,) )
		else:
			print( 'Warning: no kinect devices found' )
开发者ID:Stallion12,项目名称:pyppet,代码行数:7,代码来源:Kinect.py

示例8: __init__

 def __init__(self):
     
     self.closed = False
     
     self.objects = {}
     
     self.scale = 3
             
     master = Tk()
     
     master.title("B0rbit - The ultimate DarkOrbit b0t. Beta v0.1")
     
     master.protocol("WM_DELETE_WINDOW", self._winExitHandler)
     
     self.w = Canvas(master, width=200 * self.scale, height=125 * self.scale)
     self.w.pack()
     
     self.w.create_rectangle(0, 0, 200 * self.scale, 125 * self.scale, fill="black")
     
     self._lineHeroY = self.w.create_line(0 * self.scale, 55 * self.scale, 200 * self.scale, 55 * self.scale, fill="blue")
     self._lineHeroX = self.w.create_line(100 * self.scale, 0 * self.scale, 100 * self.scale, 125 * self.scale, fill="blue")
     
     self._textInfoBox = self.w.create_text(10, 10, anchor=NW, text="Lade...", fill="white")
     
     threading._start_new_thread(mainloop, ())
开发者ID:agrafix,项目名称:B0rbit,代码行数:25,代码来源:GUI.py

示例9: run

    def run(self):
        self._sock.listen(5)
        while True:
            conn, addr = self._sock.accept()
            print("Connected with " + addr[0] + ":" + str(addr[1]))

            _start_new_thread(self.diffieHellmanThread, (conn,))
开发者ID:FurZzZ,项目名称:secProtocolsPython,代码行数:7,代码来源:server.py

示例10: tell_story

def tell_story(count):

    time.sleep(5)
    print(story[count])

    if not count + 1 == len(story):
        threading._start_new_thread(tell_story, (count + 1,))
开发者ID:gothandy,项目名称:ingenuity,代码行数:7,代码来源:stopandgo.py

示例11: start

	def start(self):
		self.active = True
		self.loops = 0
		if hasattr(self,'setup'): self.setup()
		if threading:
			threading._start_new_thread( self.loop, () )
		else:
			thread.start_new_thread( self.loop, () )
开发者ID:A-K,项目名称:naali,代码行数:8,代码来源:pyppet.py

示例12: connect

def connect():
    print("connect()")
    global s, conn, CONN_Flag
    while 1:
        conn, addr=s.accept()
        CONN_Flag=True
        threading._start_new_thread(recv_msg,())
        print("connect success :", addr)
开发者ID:leeinwoo,项目名称:my_smart_home,代码行数:8,代码来源:temp_control.py

示例13: connect

 def connect(self, address, listenerport):
     # self.connectionsCatcher.terminate()
     self.sender.connect((address, listenerport))  # I sender connects to II listener
     self.connecting = True
     self.sender.send(str(self.listenerBase.getsockname()[1]).encode())  # I sender sends I listener's port to IIs
     # look at ConnectionsCatcher
     # I listener accepts connection from II sender
     theirAddress, theirPort = address, listenerport
     threading._start_new_thread(self.THREAD_listener, ())
开发者ID:leoniduvk,项目名称:communicator-alpha,代码行数:9,代码来源:ClientClass.py

示例14: alarm

 def alarm(secs):
     def wait(secs):
         for n in xrange(timeout_secs):
             time.sleep(1)
             if signal_finished: break
         else:
             #thread.interrupt_main()
             exec_errors.append(SafeEvalTimeoutException(secs).message)
     #thread.Start_new_thread(wait, (secs,))
     threading._start_new_thread(wait, (secs,))
开发者ID:Labo-Web,项目名称:Labo-Web,代码行数:10,代码来源:SafeEvalVisitor.py

示例15: __init__

 def __init__(self, parent, mylist, header, *args):
     QAbstractTableModel.__init__(self, parent, *args)
     self.mylist = mylist
     self.header = header
     self.count = 0
     self.timer = QTimer()
     #self.timer.setInterval(1)
     self.timer.start(1000)
     self.timer.timeout.connect(self.timerHit)
     threading._start_new_thread(self.updateData, ())
开发者ID:abdullah-sr,项目名称:Force-Signal-Plotter,代码行数:10,代码来源:tt.py


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