[python-win32] regarding invoking command prompt using python

Gerdus van Zyl gerdusvanzyl at gmail.com
Wed Jun 17 15:31:36 CEST 2009


1)
filename = "C:/Program Files (x86)/NSIS/makensisw.exe"
doc = "install.nsi"
status = os.system('""%s" "%s"' % (filename, doc))
print "Status: ", status

If you have long running program you want the output from there are
other options but the above is easiest imho.

2) just open the python file using the console python (python.exe)
interpreter not pythonw.exe; You will get a console window.

~Gerdus

On Wed, Jun 17, 2009 at 2:24 PM, a h<ah.kode at gmail.com> wrote:
> Hi all
>
> 1.I want to know how do i write batchfile kind of file in python so that it
> executes some commands. Code snippets are required.
> 2.As well how do i invoke command prompt.
>
> Actually what i need is that i have to perform certain things in
> windows...first i have to go to start->run->type cmd
> then command prompt window is open... in that to run an .exe i have to give
> the whole path like this c:\> cd temp_folder\next_folder\test.exe... and
> many more commands...
> So I want this to be perfomed in python. please help
> Thanx in advance
> Thnx & rgds
> ah
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
>


More information about the python-win32 mailing list