[Tutor] Calling Python Functions from Powershell scripts

Nikunj Badjatya nikunjbadjatya at gmail.com
Wed Oct 5 09:32:23 CEST 2011


Howdy All,

To give an overview of the problem,
I have an installer. It is used to install virtual machines at specific
location.
The installer is written in Powershell and Python. The topmost script is in
Python ( install.py ) which internally calls other .py and .PS1 ( powershell
) scripts using popen() .
I am working on having a file based logging mechanism for this installer.
i.e both for .py and .PS1 scripts.

Q1. I want to use python logging module. But then how do I integrate it with
powershell scripts. ?
One option would be to write into a .log file using logging module in all
.py scripts. Use that ( .log ) file
in powershell scripts by using its own logging module ( dnt knw if it exists
! )

Q2. Can we call / run  .py from inside .PS1. ?

Please suggest suitable methods for effective logging mechanism.

Thanks

Nikunj
Bangalore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111005/cf6bc19b/attachment.html>


More information about the Tutor mailing list