{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import os\nimport io\nimport zipfile\nimport csv\nimport pandas as pd\n\nfilepath = os.path.join('/kaggle/input/aiethicsanalysisessay', 'Ethics of Artificial Intelligence Analysis.txt')\n\nwith open(filepath, 'r') as f:\n    essay = f.read()\n\nwith zipfile.ZipFile('output.zip', 'w') as zip:\n    zip.writestr('essay.txt', essay)\n\nwith zipfile.ZipFile('output.zip', 'r') as zip:\n    with open('essay.csv', 'w', newline='') as csvfile:\n        writer = csv.writer(csvfile, delimiter=',')\n        for line in zip.read('essay.txt').splitlines():\n            writer.writerow([line])\n    with open('submission.csv', 'w', newline='') as csvfile:\n        writer = csv.writer(csvfile, delimiter=',')\n        writer.writerow(['type', 'value'])\n    with open('submission.csv', 'a', newline='') as csvfile:\n        writer = csv.writer(csvfile, delimiter=',')\n        writer.writerow(['essay_category', 'AI ethics'])\n        writer.writerow(['essay_url', 'https://www.kaggle.com/code/mayanessmith/notebook887398217d/edit/run/135646590'])\n        writer.writerow(['feedback1_url', 'http://www.kaggle.com/.../your_1st_peer_feedback'])\n        writer.writerow(['feedback2_url', 'http://www.kaggle.com/.../your_2nd_peer_feedback'])\n        writer.writerow(['feedback3_url', 'http://www.kaggle.com/.../your_3rd_peer_feedback'])\n  ","metadata":{"execution":{"iopub.status.busy":"2023-07-05T00:02:00.662710Z","iopub.execute_input":"2023-07-05T00:02:00.663153Z","iopub.status.idle":"2023-07-05T00:02:00.680807Z","shell.execute_reply.started":"2023-07-05T00:02:00.663119Z","shell.execute_reply":"2023-07-05T00:02:00.679558Z"},"trusted":true},"execution_count":null,"outputs":[]}]}