File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 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" )
You can’t perform that action at this time.
0 commit comments