Quote:how would i go about when they hit the submit button it runs a powershell command with the variables the user has inputtedOn Server get values back so here i just use new_password(can use any field) and use subprocess to run this command line argument.
ls(list files) not in standar Windows use dir,so see that in now list files in folder.
1 2 3 4 |
new_password = form.new_password.data print (new_password) # ls result = subprocess.run([new_password], capture_output = True , text = True ) print (result.stdout) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
G:\all_flask\ 2024 \wtf_env (wtf_env) λ flask - - app test1 run * Serving Flask app 'test1' * Debug mode: off WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on http: / / 127.0 . 0.1 : 5000 Press CTRL + C to quit 127.0 . 0.1 - - [ 30 / May / 2024 23 : 38 : 15 ] "GET / HTTP/1.1" 200 - ls __pycache__ Include Lib pyvenv.cfg Scripts templates test.py test1.py prod 127.0 . 0.1 - - [ 30 / May / 2024 23 : 38 : 22 ] "POST / HTTP/1.1" 200 - |