예제 #1
0
파일: app.py 프로젝트: Sumbo-1/Twitter-Bot
 	def login(self):
 		bot = self.bot 
 		bot.get('https://twitter.com/')
 		time.slep(3)
 		email = bot.find_element_by_class_name('email-input')
 		password = find_element_by_name('session[password]')
 		email.clear()
 		password.clear()
 		email.send_keys(self.username)
 		password.send_keys(self.password)
 		password.send_keys(keys.RETURN)
 		time.sleep(3)
예제 #2
0
	def install(self):
		print('mapname = ' + self.mapname)
		print('homepage = ' + self.homepage)
		print('map_homepage = ' + self.map_homepage)
		print('Installing Files...')
		## subproccess.call([C://Dekstop/nazi_zombie_lorkeep.exe])
		time.sleep(2)
		print('Creating Box...')
		time.sleep(2)
		print('Downloading Custom Models')
		time.slep(2)
		print('Lorkeep Successfuly Installedd')
    def read(self):
        pub = rospy.Publisher("limit_check",
                              Status_limit_msg,
                              queue_size=10,
                              latch=True)
        st = Status_limit_msg()
        while self.stop_flag == 0:

            try:
                st.error_box = self.error_box
                st.error_msg = self.msg
                pub.publish(st)
            except:
                rospy.logerr("no publish")
                self.stop_flag = 1

            time.slep(0.1)
예제 #4
0
def transmit_code(code):
    '''Transmit a chosen code string using the GPIO transmitter'''
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(TRANSMIT_PIN,GPIO.OUT)
    for t in range(NUM_ATTEMPTS):
        for i in code:
            if i=='1':
                GPIO.output(TRANSMIT_PIN,1)
                time.sleep(short_delay)
                GPIO.output(TRANSMIT_PIN,0)
                time.sleep(long_delay)
            elif i=='0':
                GPIO.output(TRANSMIT_PIN,1)
                time.slep(long_delay)
                GPIO.output(TRANSMIT_PIN,0)
                time.sleep(short_delay)
            else:
                continue
        GPIO.output(TRANSMIT_PIN,0)
        time.sleep(extended_delay)
    GPIO.cleanup()
예제 #5
0
def contact():
    os.system("clear")
    print logo
    print("\033[1;97m[1]\033[1;91m-⋄-\033[1;93mFacebook")
    time.slep(0.05)
    print("\033[1;97m[2]\033[1;91m-⋄-\033[1;93mInstagrame")
    time.slep(0.05)
    print("\033[1;97m[3]\033[1;91m-⋄-\033[1;93mYoutube")
    time.slep(0.05)
    print("\033[1;97m--------------------------------------------------")
    contact_info()
예제 #6
0
def test_message_disappeared_after_adding_product_to_basket(browser):
    page = ProductPage(browser, link)
    page.open()
    page.add_product_to_basket()
    time.slep(1)
    page.is_disappered_success_message()
def my_ble_rsp_gap_set_adv_parameters(sender, args):
	time.slep(0.5)
# vim:fenc=utf-8
#
# Copyright © 2015 cameron <cameron@Megatron-Virtual>
#
# Distributed under terms of the MIT license.

"""
This is your first cross network helloworld system. This module runs on the
raspberry pi side and simply pushes out world when it is connected to. This
will complete the message sent from the client side of Hello(client) +
World(Server)
"""

import zmq
import time


context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.bind("tcp://192.168.1.126:5556")  # Change this to your Raspi's Address
time.sleep(1)
while True:
    # This section will sit and wait for a request from client
    message = socket.recv()
    print("Recieved request: %s" % message)
    # Insert some delay so you can actually see the message going back and forth
    time.slep(1)

    # Sending of the response
    socket.send(b"World")
예제 #9
0
userList = ['tderr','noone']
unfoundUserlist = []

dr = driver.mycon()
#dr.get('https://bz.labs.lenovo.com/editusers.cgi')
userInput = dr.find_element_by_xpath('//input[1][contains(@id,"matchstr")]')
searchButton = dr.find_element_by_xpath('//input[2][contains(@id,"search")][contains(@type,"submit")]')


for user in userList:
    dr.get('https://bz.labs.lenovo.com/editusers.cgi')
    dr.find_element_by_xpath('//input[1][contains(@id,"matchstr")]').send_keys(user)
    time.sleep(.5)
    dr.find_element_by_xpath('//input[2][contains(@id,"search")][contains(@type,"submit")]').click()
    time.slep(1)
    try:
        dr.find_element_by_partial_link_text(user).click()
        time.sleep(1)
        dr.find_element_by_id('group_32').click()
        time.sleep(.5)
        dr.find_element_by_id().click()
        sleep(.5)
        dr.find_element_by_id().click()
        time.sleep(.5)

    except:
        unfoundUserlist.append(user)

print(unfoundUserlist)
    
          jogo = True
         else:
            game_over = True
     else:
         print('Você voltou para o inicio')
         cenario_agora = 'inicio'
 elif spawn_monstros < 130 and camisa_preta == False:
     print('um InsperBoy de ressaca da TETTO apareceu!')
     print('o que deseja fazer? "lutar" ou "fugir"?')
     luta = input('o que fazer? - ')
     if luta =="lutar":
         print('')
         print('O InsperBoy fala que vai te chamar para um camarote na sutton e tem 25 de vida')
         print('você tem {0} de vida!'.format(vida_jogador))
         print('')
         time.slep(0.5)
         while vida_jogador>0 and vida_InsperBoy>0:
             attk_jogador = random.randint(5, 16)
             print('você deu {0} de dano no InsperBoy!'.format(attk_jogador))
             print('')
             time.sleep(1)
             attk_InsperBoy = random.randint(1,8)
             print('InsperBoy deu {0} de dano em você!'.format(attk_InsperBoy))
             print('')
             time.sleep(0.5)
             vida_jogador -= attk_InsperBoy
             print('Você tem {0} de vida!'.format(vida_jogador))
         if vida_jogador > 0:
             print('você derrotou o InsperBoy e não irá estourar o limite do cartao do papai!')
             print('')
             camisa_preta = True
예제 #11
0
from flask import Flask
from serial import Serial
import time

app = Flask(__name_)

def arduino(chr:
  ser = Serial('/dev/ttyACM0',9600)
  ser.timout = 1
  time.sleep(1)
  ser.setDTR(level = 0)
  time.sleep(1)
  ser.write(chr)
  time.slep(.001)
  a = ser.read()
  ser.close()
  return a
  
@app.route("/")
def hello():
  pot = arduino('0')
  water = arduino('1')
  coffee = arduino('2')
  return ""+pot+water+coffee
  
if __name__=="__main__":
  app.run(host='0.0.0.0', port 80, debug(True)
예제 #12
0
leftBN = 4
rigthBN = 3
leftLED = 15
rightLED = 14

GPIO.setmode(GPIO.BCM)
GPIO.setup(leftBN,GPIO.IN,pull_up_down=GPIO.PUD_UP)
GPIO.setup(rightBN,GPIO.IN,pull_up_down=GPIO.PUD_UP)
GPIO.setup(leftLED,GPIO.OUT)
GPIO.setup(rightLED,GPIO.OUT)

def ledOn(pin):
    GPIO.output(pin, 1)
    time.sleep(3)
    GPIO.output(pin, 0)

def bnClick(channel):
    threading.Thread(target=ledOn, args=[leftLED if channel == leftBN else rightLED]).start()

GPIO.add_enent_detect(leftBN, GPIO.BOTH, callback=bnClick)
GPIO.add_enent_detect(rightBN, GPIO.BOTH, callback=bnClick)

try:
    while True:
        time.slep(1000000)

except KeyboardInterrupt:
    pass
GPIO.cleanup()
예제 #13
0
import speech_recognition as sr  # pip install speechrecognition
from time import sleep as slep  # sleep functuon
import tweepy  # pip install tweepy

import keys  # imports the keys file
'''Twitter API keys'''
auth = tweepy.OAuthHandler(keys.consumer_key, keys.consumer_secret)
auth.set_access_token(keys.access_token, keys.access_token_secret)
api = tweepy.API(auth)
'''Voice recognizer object'''
r = sr.Recognizer()

with sr.Microphone(
        device_index=1) as source:  # microphone may have to be changed
    while True:
        try:
            '''Listens to your voice, prints and tweets it'''
            audio = r.listen(source)
            slep(2)
            voice_text = r.recognize_google(audio)
            print(voice_text)
            final = "Tweet from voice: \n" + voice_text
            api.update_status(str(final))

        except sr.UnknownValueError:
            '''If it doesn't hear what you say'''
            print('Unkown ')