Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run_in_terminal(upperlevel_id):
robotcasename = "test00" + str(upperlevel_id) + ".txt"
k = PyKeyboard()
sub = os.popen("where python")
pathone = sub.read()
regx = re.split('python.exe',pathone)
runpath = '"' + regx[0] + 'Scripts\pybot.bat' + '"' + ' -d results '+ robotcasename
pyautogui.keyDown('alt')
pyautogui.press('f12')
pyautogui.keyUp('alt')
time.sleep(3)
switch_langrage()
k.type_string('cd robotframework')
time.sleep(1)
pyautogui.press('enter')
time.sleep(1)
k.type_string(runpath)
time.sleep(1)
pyautogui.press('enter')