[Tutor] ProgressBar - Python and Powershell
Nikunj.Badjatya at emc.com
Nikunj.Badjatya at emc.com
Sun Nov 20 14:00:43 CET 2011
Can anyone throw some light on this please. ! ?
From: tutor-bounces+nikunj.badjatya=emc.com at python.org [mailto:tutor-bounces+nikunj.badjatya=emc.com at python.org] On Behalf Of Nikunj.Badjatya at emc.com
Sent: Thursday, November 17, 2011 4:21 PM
To: tutor at python.org
Subject: [Tutor] ProgressBar - Python and Powershell
Hi All,
I am using Python 2.7, windows Env.
I have an Installer written in Python(45%) and Powershell(55%) which is used to install Virtual Machines at specific locations. It is single threaded.
I am trying to implement a ProgressBar for this installer. So that the user will come to know the progress of the installation.
I am using pypi progressbar module.
The top script is in python which inturns calls powershell scripts using subprocess.call() and proceeds with the installation.
I am taking a shared file between python and powershell, so that diff functions can update their %age completion level in to the file. Ex. Func1() updates it to 5%, func2() will add its own 5% to it.. and so on.
At the start of the (main.py) script I am creating a thread whose sole purpose would be to keep "READ" a temp file for a new entry in it.
Based on this entry I can have my thread update the progressbar on the console.
My questions are:
1. Can I have a better shared mechanism between python and powershell.? As I am using a file here. Reading + writing in python and writing only in powershell. !
2. Does this thread mechanism work.? I am yet to implement and test it.! :P What can be the possible shortfalls.?
Thanks
Nikunj
Bangalore - India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111120/4f131eb6/attachment.html>
More information about the Tutor
mailing list