TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Python code that obtains the parameter that was sent to alexa, and puts it on the clipboard

    General Discussion
    1
    1
    131
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Nico RamirezN
      Nico Ramirez
      last edited by

      The parameter is also stored in the variable 'par'

      import pyperclip as clipboard    
      import time   
      time.sleep(2)
      ruta = r"C:\Users\nicoa\.TRIGGERcmdData\debug.log" 
      
      with open(ruta,"r") as f:
          lista=[]
          x=1
          texto=[]
         
          for i in f:
              texto.append(i)
          for pos,char in enumerate((texto[-3])):     
      
              if(char == '.'): 
                  x=x+1
              if char== '\'' :
                  x=x+1              
              if x==2:
                  lista.append(char)
              
          lista.pop(0)
          par="".join(lista)
          clipboard.copy(par)
      
      1 Reply Last reply Reply Quote 1
      • First post
        Last post