# Entscheidung welcher Participant def quest(): while True: try: num = int(input('0 = alle Partisypants\nGebe paticipant an:')) if num == 0: return '' else: outfile = ' where participant_id = ' num = str(num) outfile+= num return outfile except: print("Muss ein int sein") # Erstellt den Command def creator(num): if num == '2': #event outfile = 'SELECT * FROM ex_42.eem_event' outfile+= quest() outfile+= ' order by sample_time;' return outfile elif num == '1': #track outfile = 'select participant_id, sample_time, pos_lon, pos_lat, pos_z from ex_42.rec_participant_position' outfile+= quest() outfile+= ' order by participant_id;' return outfile # Erstellt die Datei def statement(num): with open('statement.spl','w') as datei: datei.write(creator(num))