os.exec call formats

os.execv(program, commandlinesequence)

The basic “v” exec form is passed an executable program’s name, along with a listor tuple of command-line argument strings used to run the executable (that is, thewords you would normally type in a shell to start a program).

os.execl(program, cmdarg1, cmdarg2,... cmdargN)

The basic “l” exec form is passed an executable’s name, followed by one or morecommand-line arguments passed as individual function arguments. This is thesame as os.execv(program, (cmdarg1, cmdarg2,...)).

os.execlp
os.execvp

Adding the letter p to the execv and execl names means that Python will locate theexecutable’s directory using your system search-path setting (i.e.,PATH).

os.execle
os.execve

Adding a letter e to theexecvandexeclnames means an extra, last argument is adictionary containing shell environment variables to send to the program.

os.execvpe
os.execlpe

Adding the letters p and e to the basicexecnames means to use the search pathandto accept a shell environment settings dictionary. 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章