Python + Win32: Cut/Paste w/o GUI

Steve Holden sholden at holdenweb.com
Sun Oct 6 17:17:33 CEST 2002


"Tim Daneliuk" <tundra at tundraware.com> wrote...
> Steve Holden wrote:
> > "Tim Daneliuk" <tundra at tundraware.com> wrote in ...
> >
> >>Disclaimer:  I'm *much* more comfortable with Unix innards than Win32,
so
> >
> > if
> >
> >>the question I am about to ask is stoopid, please bear with me...
> >>
> >>
> >>I want to be able to do the following but am unclear if/how it can be
> >
> > done:
> >
> >>1) Write a non-GUI Python script.
> >>
> >>2) Create a shortcut in Win32 to that script.
> >>
> >>3) Copy text from an arbitrary Win32 application.
> >>
> >>4) Paste the copied text to the aforementioned shortcut/python script
and
> >>    have that pasted text be somehow available (argv[] ???) for use by
> >
> > that
> >
> >>    script.
> >>
> >>Can this be done?
> >
> >
> >
> > Sadly, I don't believe that it can. Certainly attempts to drag-and-drop
text
> > from another window change the cursor into a "no-entry" sign over
program
> > icons, implying that Windows doesn't regard them as legitiamte drop
targets.
> >
> > Neither does the context-menu item on a program shortcut include a
"Paste"
> > option.
> >
>
> Well you definitely *can* paste text to a DOS box, at least under Win2K.
> You copy the text as usual, highight the DOS box and right click the
mouse -
> text pasted!
>

Yes, but that's pasting into a running program, not pasting into an icon
which then runs the program and somehow makes the text available. Since
there have now been at least three different responses, apparently none of
them doing what you want, perhaps you could be a little more explicit about
your requirements?

regards
-----------------------------------------------------------------------
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Previous .sig file retired to                    www.homeforoldsigs.com
-----------------------------------------------------------------------






More information about the Python-list mailing list