We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a42216 commit 102d111Copy full SHA for 102d111
1 file changed
bin/PyServer.py
@@ -0,0 +1,29 @@
1
+# PyServer 1.0 - PyWimVBA 6.0
2
+from flask import Flask,request
3
+app = Flask(__name__)
4
+from io import StringIO
5
+from contextlib import redirect_stdout
6
+from traceback import format_exc
7
+import sys
8
+value = {}
9
+@app.route("/")
10
+def main():
11
+ if request.args.get("code") == None:
12
+ return "PyWimVBA server, this does nothing"
13
+ elif request.args.get("code") == "$clear":
14
+ sys.modules[__name__].__dict__.clear()
15
+ return "Cleared"
16
+ else:
17
+ cpde = request.args.get("code")
18
+ f = StringIO()
19
+ cpde = cpde.replace(";;","\n")
20
+ with redirect_stdout(f):
21
+ try:
22
+ exec(cpde, globals())
23
+ except:
24
+ te = format_exc()
25
+ return te.replace("\n",";;")
26
+ s = f.getvalue()
27
+ return s
28
+if __name__ == "__main__":
29
+ app.run(debug=True,host="0.0.0.0",port="9812")
0 commit comments