Python Forum
making a form purely with flask-wtf
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
making a form purely with flask-wtf
#11
Quote:how would i go about when they hit the submit button it runs a powershell command with the variables the user has inputted
On 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 -
Reply


Messages In This Thread
RE: making a form purely with flask-wtf - by snippsat - May-30-2024, 09:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beta6 of my password flask-wtf web form robertkwild 3 1,185 Jul-02-2024, 10:30 AM
Last Post: robertkwild
  Show powershell errors in flask-wtf web form robertkwild 14 2,625 Jun-30-2024, 03:15 PM
Last Post: robertkwild
  Running powershell command in flask wtf form robertkwild 10 2,352 Jun-27-2024, 09:49 AM
Last Post: robertkwild
  using split in my flask wtf form robertkwild 1 795 Jun-11-2024, 05:19 PM
Last Post: deanhystad
  error while inserting values into a table from form in flask in postgreSQL sahilsiddharth 3 8,407 Jun-05-2017, 07:49 PM
Last Post: sahilsiddharth

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020