当我使用subprocess.Popen运行cts时,它总是进入非交互模式然后停止。
非交互模式:运行初始命令然后退出。
以下是我使用的代码。
subprocess.Popen(command_list,stdout = subprocess.PIPE,stderr = subprocess.STDOUT)
String selectQry = ("SELECT * from ( " +
"SELECT DISTINCT at_cub_details.cd_id as cdid, " +
"at_cub_details.grp_id as grpid, " +
"at_cub_details.cd_surname as surname, " +
"at_cub_details.cd_first_name as firstName, " +
"at_cub_details.cd_dob as dob, " +
"at_cub_details.cd_photograph as photograph, " +
"at_cub_details.cd_archived as archived, " +
"at_cub_details.cd_scout_no as scoutNo " +
"FROM at_account_group, at_cub_details " +
"LEFT JOIN at_cub_awards ON (at_cub_details.cd_id = at_cub_awards.cd_id AND at_cub_awards.aw_id = ?) " +
"WHERE at_cub_awards.cd_id IS NULL " +
"AND at_cub_details.grp_id = at_account_group.grp_id " +
"AND at_account_group.acc_id = ? " +
"UNION " +
"SELECT DISTINCT at_cub_details.cd_id as cdid, " +
"at_cub_details.grp_id as grpid, " +
"at_cub_details.cd_surname as surname, " +
"at_cub_details.cd_first_name as firstName, " +
"at_cub_details.cd_dob as dob, " +
"at_cub_details.cd_photograph as photograph, " +
"at_cub_details.cd_archived as archived, " +
"at_cub_details.cd_scout_no as scoutNo " +
"FROM at_account_group, at_cub_details, at_cub_awards, at_cub_award_date " +
"WHERE at_cub_details.grp_id = at_account_group.grp_id " +
"AND at_account_group.acc_id = ? " +
"AND at_cub_awards.cd_id = at_cub_details.cd_id " +
"AND (at_cub_awards.aw_id = ? AND at_cub_awards.ca_awarded_date IS NULL) " +
"AND (at_cub_awards.ca_id = at_cub_award_date. ca_id " +
"AND at_cub_award_date.cad_task_completion_date IS NULL " +
"AND at_cub_award_date.ad_id = ?) " +
"UNION " +
"SELECT DISTINCT at_cub_details.cd_id as cdid, " +
"at_cub_details.grp_id as grpid, " +
"at_cub_details.cd_surname as surname, " +
"at_cub_details.cd_first_name as firstName, " +
"at_cub_details.cd_dob as dob, " +
"at_cub_details.cd_photograph as photograph, " +
"at_cub_details.cd_archived as archived, " +
"at_cub_details.cd_scout_no as scoutNo " +
"FROM at_account_group, at_cub_details, at_cub_awards " +
"LEFT JOIN at_cub_award_date ON (at_cub_awards.ca_id = at_cub_award_date.ca_id) " +
"WHERE at_cub_award_date.ca_id IS NULL " +
"AND at_cub_awards.ca_awarded_date IS NULL AND at_cub_awards.aw_id = ? " +
"AND at_cub_details.grp_id = at_account_group.grp_id " +
"AND at_account_group.acc_id = ? " +
"AND at_cub_awards.cd_id = at_cub_details.cd_id " +
" ) a " +
"ORDER BY surname, firstName;");