[BangPypers] python - print spooling monitoring
Senthil Kumaran
orsenthil at gmail.com
Sat May 15 17:14:13 CEST 2010
On Sat, May 15, 2010 at 01:08:17PM +0530, Gaurav Kalra wrote:
> Hi. I need some help for the following scenario.
> A process that keeps on monitoring the print spooler ..... when u try to
> spool something, it asks for ur details like name, number etc., save them
> along with the number of pages u printed and prints only when u provide the
> same .... (nice stuff for public pc's where u need to make an entry into the
> register after printing) ...... how wud i make this abstract view tangible
> ?? .... plz show a road to start on ...
You might want to split your requirement into more tangible and
defined items for your programing solution.
- If you need a monitoring service. First try write a small monitoring
service. Active state cookbook has some recipes.
- If you need to wrap a system executable using Python. Write a python
function which wraps that system executable. E.g. is if you want to
wrap 'ls and its options' you write a function like
def listdir(dir, *options) and then inside the function construct
the ls command and pass it subprocess module. This is just a crude
definition. YMMV.
- Try to combine these two steps and see if that is your desired
result. If not, rinse and repeat.
HTH,
--
Senthil
Thank God I'm an atheist.
More information about the BangPypers
mailing list