os.popen problem
Matthew K Jensen
mattjensen at timetospare.net
Mon Aug 30 01:07:05 EDT 2004
"Tom B." <sbabbitt at commspeed.net> wrote in message news:<1093798880.792738 at news.commspeed.net>...
> "Matthew K Jensen" <mattjensen at timetospare.net> wrote in message
> news:173c23bb.0408282255.2f1be2ee at posting.google.com...
> > Ok, this might seem odd as to why I am doing this in this certain way,
> > but it's for a very specific purpose, and in so doing needs to be done
> > this way. I am writing code on a winbloze box like so:
> >
> I have never gotten popen to work correctly in windows, maybe you could
> try writing a batch file or download The Python for Windows extensions
> at http://starship.python.net/crew/mhammond/ and do something like.
>
> from win32com.client import constants
> import win32con
> import win32com
> shell = win32com.client.Dispatch("WScript.Shell")
> shell.Run('notepad.exe')
> shell.SendKeys('And now for something completely different')
>
> but SendKeys only sends to the window with focus
>
> Tom
> --
I have to be running the command "copy con somefilename". And I have
to be able to tell this command to terminate in the normal fashion.
Normally when operating on the command line, one uses either F6 or
Ctrl-Z. This is a very old trick stemming from oldschool DOS. I can't
specify why I am doing this certain thing this way, for reasons of not
giving away the idea I have prematurely. I guess the real problem is
right where I input '^Z'. Does anybody have any clue on how to do
this?
More information about the Python-list
mailing list