ContributionsMost RecentMost LikesSolutionsRe: Call and wait on a .bat file in python script Hi Alex, thank you very much for your answer. For anyone looking, here's the lesser version in Python (I will add StdErr and proper error handling): def ExecuteShellCommand(command): oShell = Sys.OleObject["WScript.Shell"] execution = oShell.Exec(command) while execution.Status is 0: aqUtils.Delay(100); exitCode = int(execution.ExitCode) stdOut = '' if not execution.StdOut.AtEndOfStream: stdOut = execution.StdOut.ReadAll() report = '***COMMAND:\n\n' + command + '\n\n***RESULT:\n\n' + stdOut if exitCode != 0: Log.Error(report) else: Log.Message(report) Retrieving the column names from the result of an ADO database query in Python Hi all, I want to create a somewhat generic function in Python where I get a key/value dictionary from a database query that I know returns only one row. I want to do something like this: def GetEmployeeInfo(employeeId): Conn = ADO.CreateADOCommand(); Conn.ConnectionString = "Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=********;Password=********;Data Source=********:****" # I get ALL the columns from the table Conn.CommandText = "SELECT * FROM Employee WHERE EmployeeId = :paramEmployeeId" Conn.CommandType = cmdText; Conn.Parameters.Items[0].Value = employeeId; data = Conn.Execute(); data.MoveFirst(); result = {} # Here, I would like to build a dictionnary like: # result[COLUMN_NAME] = data.Fields.Item[index].Value # but I have no idea how to retrieve the column name # and cannot find any detailed documentation of methods and # properties around data or data.Fields, etc... for index in range(data.Fields.Count): Log.Message(data.Fields.Item[index].Value) return result Now, I am able to get all the cell values from the returned database row, but I need something that would get me this sort of result: result = GetEmployeeInfo(99) Log.Message(result["EmployeeId"]) Log.Message(result["FirstName"]) Log.Message(result["LastName"]) (...) I am sure this is doable, but I find the API documentation quite lacking when it comes to finding out about all available methods or properties of objects coming from ADO commands. Thanks in advance for your help, Regards SolvedCall and wait on a .bat file in python script Hi, I am using python script to invoke a .bat file on Windows. This bat file contains a call to ssh.exe: ssh.exe user@targetserver 'some remote command' When running the batch file, I am prompted to enter a password (to authenticate the SSH session). I therefore need to wait on the proper execution of the batch file internal commands before moving along. I also need to collect the result value of the SSH method invocation. I have seen references to a Call method (see link below), but am unsure how to use it in Python and cannot find any reference to it: Call Sys.OleObject("WScript.Shell").Run("""C:\Folder1\Folder2\App_Name.bat"", 1, true") https://community.smartbear.com/t5/TestComplete-General-Discussions/How-to-wait-for-batch-file-execution-to-be-completed-before/td-p/108027 Any help appreciated, Cheers, S. Solved