How to use run_5 method in SeleniumBase

Best Python code snippet using SeleniumBase

final_project.py

Source:final_project.py Github

copy

Full Screen

...72def run_4(b4):73 global run_474 run_4 = not run_475b4 = button(text = "air",pos = scene1.title_anchor,bind=run_4)76def run_5(b5):77 global run_578 run_5 = not run_579b5 = button(text = "water",pos = scene1.title_anchor,bind=run_5)80def run_6(b6):81 global run_682 run_6 = not run_683b6 = button(text = "glass",pos = scene1.title_anchor,bind=run_6)84#scene1.bind('keydown', keyinput) # setting for the binding function85#scene2.bind('keydown', keyinput) # setting for the binding function86def get_E_field(shape1 , medium):87 if shape1 == 0:88 E_field , maxI = circle_E_field(medium)89 return E_field , maxI90 elif shape1 == 1 :...

Full Screen

Full Screen

asteroid_madness.py

Source:asteroid_madness.py Github

copy

Full Screen

1'''2 AUTHOR: Eric Becerril-Blas3'''4import matplotlib.pyplot as plt5from matplotlib.pyplot import *6import pandas as pd7from pandas import *8Ea = 1.00000 # Earth Semi Major axis9Ja = 5.20336 # Jupiter Semi Major Axis10Sa = 9.53707 # Saturn Semi Major axis11def create_dataframe(f_name,skip):12 # Open the FileName13 f = open(f_name,'r')14 # Skip over the first 3 lines of the .aei ffile15 lines = f.readlines()[skip:]16 #print(lines)17 # Close the File18 f.close()19 # Get the header file and create the header using a super complicated brute force method that could have been easily solved by going into the raw data and deleting the space between "Time" and "(years)" in the .aei file20 header_line = lines.pop(0)21 header_line = header_line.split()22 #print(header_line)23 header = []24 first_element = 'Name'25 header.append(first_element)26 for element in header_line:27 header.append(element)28 #print(lines)29 # Turning data to float values and dataframe30 new_lines = []31 for l in lines:32 l = l.split()33 for idx,item in enumerate(l):34 if idx != 0:35 l[idx] = float(item)36 new_lines.append(l)37 #print(new_lines)38 # Make dataframe out of the list of lists39 df = pd.DataFrame.from_records(new_lines)40 df.columns= header41 #print(" ")42 #print("Initial conditions of run are")43 #print(df.iloc[:1])44 df = df.iloc[1:]45 #print(df)46 return df47def append_dataframe(df, f_name):48 f = open(f_name,'r')49 # Skip over the first 3 lines of the .aei ffile50 lines = f.readlines()51 #print(lines)52 # Close the File53 f.close()54 new_lines = []55 for l in lines:56 l = l.split()57 for idx,item in enumerate(l):58 if idx != 0:59 l[idx] = float(item)60 new_lines.append(l)61 #print(new_lines)62 df2 = pd.DataFrame.from_records(new_lines)63 df2.columns = [ 'Name' ,'a' ,'e' ,'i' ,'mass' ,'Rot/day' ,'Obl']64 #print(df2)65 df = df.append(df2, ignore_index=True)66 return(df)67def rm_the_planets(df):68 for index, row in df.iterrows():69 if row['Name'] == 'EARTHMOO':70 df.drop(index, inplace=True)71 if row['Name'] == 'SATURN':72 df.drop(index, inplace=True)73 if row['Name'] == 'JUPITER':74 df.drop(index, inplace=True)75 return(df)76def mean_motion_calc(p, q, ap):77 dummy = p/(p+q)78 dummy = dummy**(2/3)79 return(dummy*ap)80def main():81 print("Hello World From asteroid_madness.py ")82 elementout = create_dataframe('run_5/element.out',3)83 elementout = append_dataframe(elementout, 'run_5/element1.out')84 elementout = append_dataframe(elementout, 'run_5/element2.out')85 elementout = append_dataframe(elementout, 'run_5/element3.out')86 elementout = append_dataframe(elementout, 'run_5/element4.out')87 elementout = append_dataframe(elementout, 'run_5/element5.out')88 elementout = append_dataframe(elementout, 'run_5/element6.out')89 elementout = append_dataframe(elementout, 'run_5/element7.out')90 elementout = append_dataframe(elementout, 'run_5/element8.out')91 elementout = append_dataframe(elementout, 'run_5/element9.out')92 elementout = append_dataframe(elementout, 'run_5/element10.out')93 elementout = rm_the_planets(elementout)94 print(elementout)95 ax = elementout.plot(kind='scatter',x='a',y='e',color='red',s=5)96 ax.set_xlabel("Semi-Major Axis")97 ax.set_ylabel("Eccentricity")98 plt.axvline(x = 1, c = 'g', label = "$a_E$ = 1.0001au") #Earths spot after 10 million years99 #plt.text(1.75,0.9,'$v_{6}$',rotation=90)100 #plt.axvline(x = 2.05, c = 'k', linestyle='--',label = "$v_6$ = 2.05au") #Earths spot after 10 million years101 #plt.text(1.75,0.9,'$v_{6}$',rotation=90)102 # Mean Motion Resonances 3:1, 5:2, 7:3 and 2:1103 # 3:1 first104 ar = mean_motion_calc(1, 2, Ja)105 print("3:1 is")106 print(ar)107 plt.axvline(x = ar, c = 'b', linestyle='--',label = "3:1 = "+ str(round(ar, 2))+"au") #Earths spot after 10 million years108 #plt.text((ar+0.1),0.9,'3:1',rotation=90)109 # 5:2110 ar = mean_motion_calc(2, 3, Ja)111 print("5:2 is")112 print(ar)113 plt.axvline(x = ar, c = 'm', linestyle='--',label = "5:2 = "+ str(round(ar, 2))+"au") #Earths spot after 10 million years114 #plt.text((ar+0.1),0.9,'5:2',rotation=90)115 # 7:3116 ar = mean_motion_calc(3, 4, Ja)117 print("7:3 is")118 print(ar)119 plt.axvline(x = ar, c = 'y', linestyle='--',label = "7:3 = "+ str(round(ar, 2))+"au" ) #Earths spot after 10 million years120 #plt.text((ar+0.1),0.9,'5:2',rotation=90)121 # 2:1122 ar = mean_motion_calc(1, 1, Ja)123 print("2:1 is")124 print(ar)125 plt.axvline(x = ar, c = 'c', linestyle='--',label = "2:1 = "+ str(round(ar, 2))+"au") #Earths spot after 10 million years126 #plt.text((ar+0.1),0.9,'5:2',rotation=90)127 plt.legend(loc=0)128 plt.show()129 plt.clf()130if __name__== "__main__":...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run SeleniumBase automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful