|
| 1 | +import xlsxwriter |
| 2 | + |
| 3 | +def menu(): |
| 4 | + #Menu |
| 5 | + print("-----------------------------ERPMate--------------------------------") |
| 6 | + print("1. Start an ERP session") |
| 7 | + print("2. Exit") |
| 8 | + menyo=int(input("Enter your choice: ")) |
| 9 | + if menyo==1: |
| 10 | + ERPsession() |
| 11 | + if menyo==2: |
| 12 | + pass |
| 13 | + |
| 14 | +def ERPsession(): |
| 15 | + #start of an erp session |
| 16 | + print("------------------------------ERP Session----------------------------") |
| 17 | + #making variables global |
| 18 | + global date,time,obssession,compulsion,anxietyatexposure,anxietyat5min,anxietyat10min,anxietyat30min,anxietyat60min |
| 19 | + #asking for input |
| 20 | + date=input("Enter today's date: ") |
| 21 | + time=input("Enter current time: ") |
| 22 | + obssession=input("Enter the obsessive thought: ") |
| 23 | + compulsion=input("Enter the compulsion: ") |
| 24 | + print("------------------Rate your anxiety at 10---------------") |
| 25 | + anxietyatexposure=input(" Rate your Anxiety at Exposure: ") |
| 26 | + anxietyat5min= input("Rate your Anxiety after 5 min: ") |
| 27 | + anxietyat10min= input("Rate your Anxiety after 10 min: ") |
| 28 | + anxietyat30min= input("Rate your Anxiety after 30 min: ") |
| 29 | + anxietyat60min= input("Rate your Anxiety after 1 hour: ") |
| 30 | + createExcelsheet() |
| 31 | + print("Data recorded in excel sheet") |
| 32 | + |
| 33 | +def createExcelsheet(): |
| 34 | + #creating an excel sheet |
| 35 | + f=input("Enter the file name in the format 'filename.xlsx': ") |
| 36 | + workbook=xlsxwriter.Workbook(f) |
| 37 | + worksheet=workbook.add_worksheet("ERPData") |
| 38 | + #adding columns |
| 39 | + worksheet.write("A1","Date") |
| 40 | + worksheet.write("B1", "Time") |
| 41 | + worksheet.write("C1","Obsession") |
| 42 | + worksheet.write("D1","Compulsion") |
| 43 | + worksheet.write("E1","Anxiety at Exposure") |
| 44 | + worksheet.write("F1","Anxiety after 5 min") |
| 45 | + worksheet.write("G1","Anxiety after 10 min") |
| 46 | + worksheet.write("H1","Anxiety after 30 min") |
| 47 | + worksheet.write("I1","Anxiety after 1 hour") |
| 48 | + |
| 49 | + #small workaround |
| 50 | + session = int(input("Enter the session number: ")) |
| 51 | + session = session + 1 |
| 52 | + sessionzero=str(session) |
| 53 | + |
| 54 | + #adding the session data to excel sheet |
| 55 | + worksheet.write("A"+sessionzero,date) |
| 56 | + worksheet.write("B"+sessionzero,time) |
| 57 | + worksheet.write("C"+sessionzero,obssession) |
| 58 | + worksheet.write("D"+sessionzero,compulsion) |
| 59 | + worksheet.write("E"+sessionzero,anxietyatexposure) |
| 60 | + worksheet.write("F"+sessionzero,anxietyat5min) |
| 61 | + worksheet.write("G"+sessionzero,anxietyat10min) |
| 62 | + worksheet.write("H"+sessionzero,anxietyat30min) |
| 63 | + worksheet.write("I"+sessionzero,anxietyat60min) |
| 64 | + |
| 65 | + workbook.close() |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +menyoo=1 |
| 77 | +#While loop for menu |
| 78 | +while menyoo==1: |
| 79 | + menu() |
0 commit comments