Best Python code snippet using SeleniumBase
colorsPython.py
Source: colorsPython.py
1def borraLaPantalla():2 return '\033[2J\033[1;1f'3def escribirNegro(texto):4 return '\033[1;30m' + texto + '\033[0;m'5def escribirRojo(texto):6 return '\033[1;31m' + texto + '\033[0;m'7def escribirRojoOpacidad(texto):8 return '\033[2;31m' + texto + '\033[0;m'9def escribirVerde(texto):10 return '\033[1;32m' + texto + '\033[0;m'11def escribirVerdeOpacidad(texto):12 return '\033[2;32m' + texto + '\033[0;m'13def escribirAmarillo(texto):14 return '\033[1;33m' + texto + '\033[0;m'15def escribirAmarilloOpacidad(texto):16 return '\033[2;33m' + texto + '\033[0;m'17def escribirAzul(texto):18 return '\033[1;34m' + texto + '\033[0;m'19def escribirAzulOpacidad(texto):20 return '\033[2;34m' + texto + '\033[0;m'21def escribirMorado(texto):22 return '\033[1;35m' + texto + '\033[0;m'23def escribirMoradoOpacidad(texto):24 return '\033[2;35m' + texto + '\033[0;m'25def escribirCian(texto):26 return '\033[1;36m' + texto + '\033[0;m'27def escribirCianOpacidad(texto):28 return '\033[2;36m' + texto + '\033[0;m'29def escribirBlanco(texto):30 return '\033[1;37m' + texto + '\033[0;m'31def escribirBlancoOpacidad(texto):32 return '\033[2;37m' + texto + '\033[0;m'33def finColor():34 return '\033[0;m'35def cargoCabecera():36 print(borraLaPantalla())37 print(escribirAmarilloOpacidad('ââââââââââââââââââââââââââââââââââââââââââââââââââââ'))38 print(escribirAmarilloOpacidad('â â'))39 print(escribirAmarilloOpacidad('â') + escribirCianOpacidad(' âââââââââ') + escribirAmarilloOpacidad(' â'))40 print(escribirAmarilloOpacidad('â') + escribirCianOpacidad(' ââ') + escribirAmarilloOpacidad(' â'))41 print(escribirAmarilloOpacidad('â') + escribirCianOpacidad(' ââ') + escribirAmarilloOpacidad(' â'))42 print(escribirAmarilloOpacidad('â') + escribirCianOpacidad(' ââ') + escribirAmarilloOpacidad(' â'))43 print(escribirAmarilloOpacidad('â') + escribirCianOpacidad(' ââ') + escribirAmarilloOpacidad(' â'))44 print(escribirAmarilloOpacidad('â') + escribirCianOpacidad(' ââ') + escribirBlancoOpacidad(' Playing with python + blockchain') + escribirAmarilloOpacidad(' â'))45 print(escribirAmarilloOpacidad('â') + escribirCianOpacidad(' âââââââââ') + escribirBlanco(' ERGOPLATFORM.ORG') + escribirAmarilloOpacidad(' â'))46 print(escribirAmarilloOpacidad('â â'))47 print(escribirAmarilloOpacidad('ââââââââââââââââââââââââââââââââââââââââââââââââââââ'))48def cargoMenu(wallet):49 print(escribirAmarilloOpacidad('ââââââââââââââââââââââââââââââââââââââââââââââââââââ'))50 print(escribirAmarilloOpacidad('â â'))51 print(escribirAmarilloOpacidad('â') + escribirCian(' tERGminal') + escribirAmarilloOpacidad(' â'))52 print(escribirAmarilloOpacidad('â â'))53 if wallet == 1:54 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('1') + escribirAmarillo(' Configure wallet. ') + escribirAmarilloOpacidad('â'))55 else:56 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('1') + escribirAmarilloOpacidad(' Configure wallet. â'))57 if wallet == 2:58 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('2') + escribirAmarillo(' Send ERG to a wallet. ') + escribirAmarilloOpacidad('â'))59 else: 60 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('2') + escribirAmarilloOpacidad(' Send ERG to a wallet. â'))61 if wallet == 3:62 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('3') + escribirAmarillo(' Send ERG to a random wallet. ') + escribirAmarilloOpacidad('â'))63 else:64 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('3') + escribirAmarilloOpacidad(' Send ERG to a random wallet. â'))65 if wallet == 4:66 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('4') + escribirAmarillo(' Send NFT to wallet. ') + escribirAmarilloOpacidad('â'))67 else:68 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('4') + escribirAmarilloOpacidad(' Send NFT to wallet. â'))69 if wallet == 5:70 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('5') + escribirAmarillo(' Send NFT to a random wallet. ') + escribirAmarilloOpacidad('â'))71 else:72 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('5') + escribirAmarilloOpacidad(' Send NFT to a random wallet. â'))73 if wallet == 6:74 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('6') + escribirAmarillo(' Send NFT random to a wallet. ') + escribirAmarilloOpacidad('â'))75 else:76 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('6') + escribirAmarilloOpacidad(' Send NFT random to a wallet. â'))77 if wallet == 7:78 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('7') + escribirAmarillo(' Create token. ') + escribirAmarilloOpacidad('â'))79 else:80 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('7') + escribirAmarilloOpacidad(' Create token. â'))81 if wallet == 8:82 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('8') + escribirAmarillo(' Create NFT. ') + escribirAmarilloOpacidad('â'))83 else:84 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('8') + escribirAmarilloOpacidad(' Create NFT. â'))85 if wallet == 9:86 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('9') + escribirAmarillo(' Info Ergo. ') + escribirAmarilloOpacidad('â'))87 else:88 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('9') + escribirAmarilloOpacidad(' Info Ergo. â'))89 if wallet == 10:90 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('10') + escribirAmarillo(' Info Wallet. ') + escribirAmarilloOpacidad('â'))91 else:92 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('10') + escribirAmarilloOpacidad(' Info Wallet. â'))93 if wallet == 11:94 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('11') + escribirAmarillo(' Info Token. ') + escribirAmarilloOpacidad('â'))95 else:96 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('11') + escribirAmarilloOpacidad(' Info Token. â'))97 if wallet == 12:98 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('12') + escribirAmarillo(' Info Transaction. ') + escribirAmarilloOpacidad('â'))99 else:100 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('12') + escribirAmarilloOpacidad(' Info Transaction. â'))101 if wallet == 13:102 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('13') + escribirAmarillo(' Send tokens to multiple addresses. ') + escribirAmarilloOpacidad('â'))103 else:104 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('13') + escribirAmarilloOpacidad(' Send tokens to multiple addresses. â'))105 106 print(escribirAmarilloOpacidad('â ') + escribirAmarillo('0') + escribirAmarilloOpacidad(' Exit. â'))107 print(escribirAmarilloOpacidad('â â'))108 print(escribirAmarilloOpacidad('ââââââââââââââââââââââââââââââââââââââââââââââââââââ'))...
graficos.py
Source: graficos.py
1#!/usr/bin/env python2# -*- coding: utf-8 -*-3"""Conjunto de rutinas para generar graficos"""4import datos5import os6def escribir_archivo(archivo, datos):7 """Escibir datos en un archivo"""8 f = open(archivo, 'w')9 f.write("0\n")10 for i in range(2, 13):11 f.write(str(datos[i]) + "\n")12 f.close()13def generar_archivos(titulo, resultado):14 """Generar un TXT a partir de un año de balance"""15 for fila in resultado:16 pass17 # $a = mysql_fetch_row($res);18 # $b = mysql_fetch_row($res);19 # $c = mysql_fetch_row($res);20 # $d = mysql_fetch_row($res);21 # $e = mysql_fetch_row($res);22 # escribir_archivo("txt/".$titulo.'_2003.txt',$a);23 # escribir_archivo("txt/".$titulo.'_2004.txt',$b);24 # escribir_archivo("txt/".$titulo.'_2005.txt',$c);25 # escribir_archivo("txt/".$titulo.'_2006.txt',$d);26 # escribir_archivo("txt/".$titulo.'_2007.txt',$e);27def generar_graficos():28 """Generación de gráficas para informe financiero"""29 pass30 # $sql_cta_cte_mes = 'SELECT * FROM balcom WHERE item LIKE "Banco 200%"';31 # $sql_cta_cte_acu = 'SELECT * FROM balcom WHERE item LIKE "Banco Acu 200%"';32 # $sql_egresos_mes = 'SELECT * FROM balcom WHERE item LIKE "Egresos 200%"';33 # $sql_egresos_acu = 'SELECT * FROM balcom WHERE item LIKE "Egresos Acu 200%"';34 # $sql_ingresos_mes='SELECT * FROM balcom WHERE item LIKE "Ingresos 200%"';35 # $sql_ingresos_acu='SELECT * FROM balcom WHERE item LIKE "Ingresos Acu 200%"';36 # $sql_ganancia_mes ='SELECT * FROM balcom WHERE item LIKE "Ganancia 200%"';37 # $sql_ganancia_acu ='SELECT * FROM balcom WHERE item LIKE "Ganancia Acu 200%"';38 # generar_archivos("cta_cte_mes",$sql_cta_cte_mes);39 # generar_archivos("cta_cte_acu",$sql_cta_cte_acu);40 # generar_archivos("egresos_mes",$sql_egresos_mes);41 # generar_archivos("egresos_acu",$sql_egresos_acu);42 # generar_archivos("ingresos_mes",$sql_ingresos_mes);43 # generar_archivos("ingresos_acu",$sql_ingresos_acu);44 # generar_archivos("ganancia_mes",$sql_ganancia_mes);45 # generar_archivos("ganancia_acu",$sql_ganancia_acu);46 # exec('gnuplot graficos.gp');47def escribir_datos(filtro, archivo):48 """Escribir datos a un archivo de texto"""49 os.unlink(archivo)50 balcom = datos.Tabla("balcom")51 balcom.filtro = filtro52 balcom.filtrar()53 # $sql = 'SELECT * FROM balcom WHERE item = "'.$filtro.'"';54 # $res = mysql_query($sql);55 # $fil = mysql_fetch_array($res);56 # $handle = fopen($file, 'w');57 # fwrite($handle, '0');58 # fwrite($handle, $fil['enero']);59 # fwrite($handle, $fil['febrero']);60 # fwrite($handle, $fil['marzo']);61 # fwrite($handle, $fil['abril']);62 # fwrite($handle, $fil['mayo']);63 # fwrite($handle, $fil['junio']);64 # fwrite($handle, $fil['julio']);65 # fwrite($handle, $fil['agosto']);66 # fwrite($handle, $fil['setiembre']);67 # fwrite($handle, $fil['octubre']);68 # fwrite($handle, $fil['noviembre']);69 # fwrite($handle, $fil['diciembre']);70 # fclose($handle);71def generar_datos():72 pass73 # exportar datos desde mysql (balcom) hasta cada archivo.txt74 # escribir_datos("Banco 2003","txt/cta_cte_mes_2003.txt")75 # escribir_datos("Banco 2004","txt/cta_cte_mes_2004.txt")76 # escribir_datos("Banco 2005","txt/cta_cte_mes_2005.txt")77 # escribir_datos("Banco 2006","txt/cta_cte_mes_2006.txt")78 # escribir_datos("Banco 2007","txt/cta_cte_mes_2007.txt")79 # escribir_datos("Banco Acu 2003","txt/cta_cte_acu_2003.txt")80 # escribir_datos("Banco Acu 2004","txt/cta_cte_acu_2004.txt")81 # escribir_datos("Banco Acu 2005","txt/cta_cte_acu_2005.txt")82 # escribir_datos("Banco Acu 2006","txt/cta_cte_acu_2006.txt")83 # escribir_datos("Banco Acu 2007","txt/cta_cte_acu_2007.txt")84 # escribir_datos("Egresos Acu 2003","txt/egresos_acu_2003.txt")85 # escribir_datos("Egresos Acu 2004","txt/egresos_acu_2004.txt")86 # escribir_datos("Egresos Acu 2005","txt/egresos_acu_2005.txt")87 # escribir_datos("Egresos Acu 2006","txt/egresos_acu_2006.txt")88 # escribir_datos("Egresos Acu 2007","txt/egresos_acu_2007.txt")89 # escribir_datos("Ganancia 2003","txt/ganancia_mes_2003.txt")90 # escribir_datos("Ganancia 2004","txt/ganancia_mes_2004.txt")91 # escribir_datos("Ganancia 2005","txt/ganancia_mes_2005.txt")92 # escribir_datos("Ganancia 2006","txt/ganancia_mes_2006.txt")93 # escribir_datos("Ganancia 2007","txt/ganancia_mes_2007.txt")94 # escribir_datos("Egresos 2003","txt/egresos_mes_2003.txt")95 # escribir_datos("Egresos 2004","txt/egresos_mes_2004.txt")96 # escribir_datos("Egresos 2005","txt/egresos_mes_2005.txt")97 # escribir_datos("Egresos 2006","txt/egresos_mes_2006.txt")98 # escribir_datos("Egresos 2007","txt/egresos_mes_2007.txt")99 # escribir_datos("Ingresos Acu 2003","txt/ingresos_acu_2003.txt")100 # escribir_datos("Ingresos Acu 2004","txt/ingresos_acu_2004.txt")101 # escribir_datos("Ingresos Acu 2005","txt/ingresos_acu_2005.txt")102 # escribir_datos("Ingresos Acu 2006","txt/ingresos_acu_2006.txt")103 # escribir_datos("Ingresos Acu 2007","txt/ingresos_acu_2007.txt")104 # escribir_datos("Ganancia Acu 2003","txt/ganancia_acu_2003.txt")105 # escribir_datos("Ganancia Acu 2004","txt/ganancia_acu_2004.txt")106 # escribir_datos("Ganancia Acu 2005","txt/ganancia_acu_2005.txt")107 # escribir_datos("Ganancia Acu 2006","txt/ganancia_acu_2006.txt")108 # escribir_datos("Ganancia Acu 2007","txt/ganancia_acu_2007.txt")109 # escribir_datos("Ingresos 2003","itxt/ngresos_mes_2003,txt")110 # escribir_datos("Ingresos 2004","txt/ingresos_mes_2004,txt")111 # escribir_datos("Ingresos 2005","txt/ingresos_mes_2005,txt")112 # escribir_datos("Ingresos 2006","txt/ingresos_mes_2006,txt")113 # escribir_datos("Ingresos 2007","txt/ingresos_mes_2007,txt")114 # escribir_datos("Egresos Acu 2003","txt/egresos_acu_2003.txt")115 # escribir_datos("Egresos Acu 2004","txt/egresos_acu_2004.txt")116 # escribir_datos("Egresos Acu 2006","txt/egresos_acu_2006.txt")117 # escribir_datos("Egresos Acu 2005","txt/egresos_acu_2005.txt")118 # escribir_datos("Egresos Acu 2007","txt/egresos_acu_2007.txt")119if __name__ == "__main__":...
Administrador.py
Source: Administrador.py
1import os2from tkinter import *3from tkinter.ttk import Combobox4from tkinter import messagebox5from LeerArchivos import Reader6from Analizar import Analizador7from Escribir import EscribirArchivo8from Reportes import Reporte9from tkinter.filedialog import askopenfilename10class Administrador:11 def __init__(self):12 self.scanner = Reader()13 self.Analizador = Analizador()14 self.Escribir = EscribirArchivo()15 self.reportes = Reporte()16 17 def setRoot(self, root):18 self.root = root19 def configMaquina(self):20 filename = askopenfilename()21 if os.path.exists(filename) == True:22 self.scanner.setMaquina(filename)23 messagebox.showinfo('Exito', 'Maquina Configurada')24 else:25 messagebox.showerror('Error', 'El archivo no existe')26 27 def genSimulacion(self):28 filename = askopenfilename()29 if os.path.exists(filename) == True:30 self.scanner.setSimulacion(filename)31 self.Escribir.escribirSimulacion(self.scanner.listaSimulacion, self.scanner.listaProductos, self.scanner.listaLineas)32 messagebox.showinfo('Exito', 'Generando simulacion.')33 else:34 messagebox.showerror('Error', 'El archivo no existe')35 def datos(self):36 datos = '''Nombre: Dennis Mauricio Corado Muñóz\nCarne: 202010406\nIntroduccion a la Programacion y Computacion 2 seccion A\nIngenieria en Ciencias y Sistemas\n4to Semestre'''37 messagebox.showinfo('Datos del Estudiante', datos)38 39 def showValues(self):40 self.nombres = self.scanner.listaProductos.getProducts()41 messagebox.showinfo('Productos', self.nombres)42 def ensamblarPr(self, nombre):43 existe = self.scanner.listaProductos.search(nombre)44 if existe == True:45 pasos = self.scanner.listaProductos.getPasos()46 self.Analizador.evaluarCadena(pasos)47 self.Analizador.instructionList.setLabel(self.root)48 self.Escribir.setRoot(self.root)49 self.Escribir.escribirIndividual(nombre,self.scanner.listaProductos, self.scanner.listaLineas)50 else:51 messagebox.showerror('Error', 'El producto no se encuentra en la maquina')52 def reporte(self):53 if self.Escribir.genSm != False:54 self.reportes.genReporte(self.Escribir.genListSm)55 elif self.Escribir.genInd != False:...
Check out the latest blogs from LambdaTest on this topic:
The QA testing profession requires both educational and long-term or experience-based learning. One can learn the basics from certification courses and exams, boot camp courses, and college-level courses where available. However, developing instinctive and practical skills works best when built with work experience.
Ever since the Internet was invented, web developers have searched for the most efficient ways to display content on web browsers.
In general, software testers have a challenging job. Software testing is frequently the final significant activity undertaken prior to actually delivering a product. Since the terms “software” and “late” are nearly synonymous, it is the testers that frequently catch the ire of the whole business as they try to test the software at the end. It is the testers who are under pressure to finish faster and deem the product “release candidate” before they have had enough opportunity to be comfortable. To make matters worse, if bugs are discovered in the product after it has been released, everyone looks to the testers and says, “Why didn’t you spot those bugs?” The testers did not cause the bugs, but they must bear some of the guilt for the bugs that were disclosed.
Xamarin is an open-source framework that offers cross-platform application development using the C# programming language. It helps to simplify your overall development and management of cross-platform software applications.
When software developers took years to create and introduce new products to the market is long gone. Users (or consumers) today are more eager to use their favorite applications with the latest bells and whistles. However, users today don’t have the patience to work around bugs, errors, and design flaws. People have less self-control, and if your product or application doesn’t make life easier for users, they’ll leave for a better solution.
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!