I am trying to have a Tkinter gui with 4 boxes that will let me add users to Centos7.
If it was a dialog using raw input it works fine but when i try to get the input from the entry fields it doesnt.
I saw other related subprocess questions but none of them used Entry frields which confuse me.
I get an error of argument is not iterable but i am sure maybe the way i declare the variables is probably wrong and the way i input into the subprocess entry the oucu,name,group fields.
Any ideas ?
from tkinter import *
import subprocess
global oucu
global fname
global sname
global group
def add():
subprocess.call(['adduser', '-N', '-g', group, '-c', fname, '-d','/home/oucu'])
root = Tk()
oucu = StringVar()
e2 = Entry(root, textvariable=oucu).grid(row=0, column=0)
fname = StringVar()
e3 = Entry(root, textvariable=fname).grid(row=1, column=0)
sname = StringVar()
e4 = Entry(root, textvariable=sname).grid(row=1, column=1)
group = StringVar()
e6 = Entry(root, textvariable=group).grid(row=0, column=1)
b1 = Button(root, text='Next', command=add).grid(row=2, column=1)
root.mainloop()