python with multiples arguments

I'm trying to call mattermost "platform" application from a python script to create users & teams from a CSV file but i'm having an issue with the command which doesn't seems to recognize any parameter passed after --name.  I'm new to python so i won't be offended if you point me the obvious.

my CSV files got columns group, group_display, email, password.

with open("./accounts.csv", "rb") as wFile:
    wReader = csv.DictReader(wFile)
    for wLine in wReader:
        wCommand = []
        wCommand.append('--name ' + wLine['group'])
        wCommand.append('--display_name \"' + wLine['group_display'] + '\"')
        print wCommand
        wRet =
        if (wRet == 0):
                print 'Imported ' + wLine['email']
                print 'Error importing ' + wLine['email']

Open in new window

i'm getting the error:

Error: unknown flag: --name mycustomername
Usage: platform team create [flags]

If i run the command from the cmd line with this command, it will pass:
./platform team create --name mycustomername --display_name "The Full Customer Name" --private

Any idea what i'm missing?
LVL 10
Christian de BellefeuilleProgrammerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nociSoftware EngineerCommented:
the --name mycustormername should be passed in two appends...

wCommand.append('--name ')
btw. same for --displayname.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Christian de BellefeuilleProgrammerAuthor Commented:
look like you nailed it!   Thanks a lot!
nociSoftware EngineerCommented:
np.   On general for unix commands Each work  on the command line should translate to an argument
If a argumentlist is required then the break up should be done by the programmer.
when you issue a shell command the shell breaks up the argument to separate words.  (hence the various quoting mechanisms to get the right result).
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.