From bfb948b8beb8956af4c91ce685ffc62d2cb28272 Mon Sep 17 00:00:00 2001 From: ljh <1461446937@qq.com> Date: Sun, 23 Apr 2023 09:29:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2.1.py | 25 +++++++++++++++++++++++++ 2.iml | 8 ++++++++ main.py | 16 ++++++++++++++++ misc.xml | 7 +++++++ modules.xml | 8 ++++++++ 5 files changed, 64 insertions(+) create mode 100644 2.1.py create mode 100644 2.iml create mode 100644 main.py create mode 100644 misc.xml create mode 100644 modules.xml diff --git a/2.1.py b/2.1.py new file mode 100644 index 0000000..f5e59ae --- /dev/null +++ b/2.1.py @@ -0,0 +1,25 @@ +from flask import Flask,request,send_file +from flask_restful import Resource,Api,reqparse + +app = Flask(__name__) +api=Api(app) +app=Flask(__name__) +api=Api(app) + +class ObjectStorage(Resource): + + def put(self,object_name): + file = request.files['file'] + file.save(object_name) + return {'status':'success'} + + def get(self,object_name): + file = open(object_name,'rb') + return send_file(file,mimetype='application/octet-stream') + + def delete(self,object_name): + pass + +api.add_resource(ObjectStorage,'/objects/') +if __name__=="__main__": + app.run() \ No newline at end of file diff --git a/2.iml b/2.iml new file mode 100644 index 0000000..d9e6024 --- /dev/null +++ b/2.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..dcafbad --- /dev/null +++ b/main.py @@ -0,0 +1,16 @@ +# This is a sample Python script. + +# Press Shift+F10 to execute it or replace it with your code. +# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. + + +def print_hi(name): + # Use a breakpoint in the code line below to debug your script. + print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint. + + +# Press the green button in the gutter to run the script. +if __name__ == '__main__': + print("hello world") + +# See PyCharm help at https://www.jetbrains.com/help/pycharm/ diff --git a/misc.xml b/misc.xml new file mode 100644 index 0000000..2882f6e --- /dev/null +++ b/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/modules.xml b/modules.xml new file mode 100644 index 0000000..a0a3dc4 --- /dev/null +++ b/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file