Problem with Dos command by python script

Chris Rebert chris at
Thu Sep 15 03:57:54 CEST 2011

On Wed, Sep 14, 2011 at 1:13 PM, Jonatas Emidio <jonatasemidio at> wrote:
> Here i come!!
> I have the following problem...
> I need run by python script a string with some "DOS commands - Windows
> prompt"!!
> For exemple:
> print 'cd temp'
> print 'mkdir temp_app'
> How can i run this string in the python, but as a DOS interpreter?

Use the `subprocess` module, and pass shell=True.


More information about the Python-list mailing list