ActivePython on Windows: References Question

eltronic at juno.com eltronic at juno.com
Tue Jan 14 16:21:33 EST 2003


On Mon, 13 Jan 2003 14:19:12 -0500 "Alex K. Angelopoulos" <aka at mvps.org>
writes:
> I am about to post an updated version of a
> WSH FAQ I keep, and wanted to get some feedback on my 
> notes about Python use from WSH.  
> 

thanks for posting, I was searching again last week but somehow 
missed any references to your site but found the Mini-FAQ somewhere.

I'm only 3months into python but have used wsh and js for years.
on win95 with activestate2.2 msi version, IE5.5
the script engine is not installed by default and 
there is some incomplete and or out of date docs.

%YOURPATH%\Python22\Lib
\site-packages\win32comext\axscript\client\pyscript.py
will register the scripting engine for IIS and wsh .pws files

%YOURPATH%\Python22\Lib
\site-packages\win32comext\axscript\client\pyscript_rexec.py
must also be run if you want scripting in IE

unfortunately most of the scripts in the demo dir don't work for me.
%YOURPATH%\Python22\Lib
site-packages\win32comext\axscript\demos\client\ie\demo.htm
another  problem is there is no list of modules which you 
can import w/o error. there is no list of statements nor much guidance 
to the differences in syntax from the more abundant examples in js and
vb.
allot of trial and error. there is a win32extensions.chm which has some 
few hints on scripting.
<language=python defer>  doesn't seem to work like the javascript

finding most of the examples in VB could be having some negative effects.
lack of enthusiasm for python as a scripting engine for wsh is likely the
non-portability issue and that python itself runs fine and has all the
API
extension hooks to do whatever you could hope to do already. why there
isn't
many visible examples of scripting IE or pick your favorite application
is
another story. probably those who have just are too busy to post their
examples.
cleaning up the rough edges and documenting takes time but would be much 
appreciated. huge loss, I'm sure there are many that could be very
interesting 
to the community at large. creating some html and calling IE isn't too
difficult
and is far easier to debug.

Mark Hammond seems to be the single source for all the win32 extensions
http://starship.python.net/crew/mhammond/win32/

http://starship.python.net/crew/mhammond/win32/PrivacyProblem.html
it appears that you can read local files, there is an updated
framework.py 
which I think only disallows scripting from IE while continuing to enable

wsh and IIS use. this might be out of date related to the 2 py files
above 
that register the extensions.

you might also edit framework.py to disable the rexec limitations or use 
the Microsoft Windows Script Control as mentioned on the ASPN python
forum.

you list Python ActiveState Open Source , I'm not quite sure their 
compilation is opensource but it is free and I believe available for
linux as well as windows. what it does do well is pull together enough
of the core and extensions to get up and running with a single install
with out having to download and compile everything.


win32trace.pyd/win32traceutil.py
These modules allow one Python process to generate output via a "print" 
statement,  and another unrelated Python process to display the data. 
This works even if the  Python process generating the output is running
under the context of a service, 

create a shortcut to win32traceutil.py. I call this from a small bat file
since
win32 programs cant remember the .pif font and position settings on win95
in the properties of the shortcut 
%YOURPATH%\wtrace.bat 
"%YOURPATH%\Python22\Lib\site-packages\win32\Lib\win32traceutil.py
wtrace.bat consists of
set pyt=%YOURPATH%\Python22\python.exe
%pyt%  %1 %2 %3 %4 %5 %6 %7 %8 %9
or something similar
now you just import win32trace in your script then the print 
get routed to the previously open window from the .bat
in IE now the print's are seen in the window the .bat opens
if you want the output in IE you have to document.writeln('whatever')

a few more links
some references and vb examples
http://www.winguides.com/article.php?id=2&guide=scripting  
example of scripting outloook
http://www.boddie.org.uk/python/COM.html 


a section on adding rclick extensions to the context menu 
would also be useful in a FAQ

> 
> FYI, the ancient version of the WSH FAQ I had is accessible from a 
> sub-page of my remote computing site:
> http://dev.remotenetworktechnology.com/wsh/
> (see the Mini-FAQ entry)
>> "some of the MSDN reference links have broken;" 

they do like to rearange things.
guess they don't like people linking into their
site for the Q##### doc's either any more.





thanks.

________________________________________________________________
Sign Up for Juno Platinum Internet Access Today
Only $9.95 per month!
Visit www.juno.com





More information about the Python-list mailing list