[Tutor] Running multiple version of Python on 1 windows machine

2006-10-30 Thread Todd Dahl
At work I have installed Python 2.4 but at home I have Python 2.5.
Until this point I didn't think nothing of it but now I have run into
a issue.

I have some code that I have worked on at work that uses the pySQLite
module which doesn't support 2.5, yet. I can run my code at work but I
can't even install the module at home.

So my question is how do I configure my machine at home so I can have
multiple versions of python running so I can run this code. Or is this
a bad and/or confusing thing to do.

Thanks

-Todd
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GUI with Designer

2006-11-03 Thread Todd Dahl
I am wanting to get into some GUI coding with Python and have heard about PyQT and wxPython. Now I am definately not looking for some type of holy war but can anyone give me a good reason to pick one over the other.

 
Also I would like to have a designer with it or a seperate designer that could be used with either. I plan on coding in Windows XP.
 
Thanks,
 
-Todd
 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Windows Registry

2006-11-09 Thread Todd Dahl
I am currently working on a project that in a small part of it I need to find keys in the windows registry. I have found _winreg but was wondering if anyone knows of any modules that people have written as a wrapper for it. I have googled like crazy but am not finding anything. What I trying to do is search the registry for a list of known keys without knowing their specific locations and then find values of the other keys around it. Hope that makes sence. 
 Thanks, -Todd
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Recursive functions and the windows registry

2006-11-16 Thread Todd Dahl

I have been fighting with this for a couple of days and am getting
frustrated with it. I am trying to figure out a way to walk through the
windows registry and to capture all nodes under the HKEY_CLASSES_ROOT\CLSID
key and then put it into a list.



I have been trying to do it with a recursive function but am having no luck
with it. I am really hoping that it's because I am new to Python and not
because I am doing something stupid but it would not be the first time I
missed something obvious.



This script is a subset of the larger script that I am working on.  Any help
or feedback would be great. I'm getting to the end of my rope.



By the way I don't understand why it seems to work inside the
ListRegistryKeys function but it doesn't pass all the information back to
the parseRegistry function.



-Todd




#!/usr/bin/env python

import _winreg # _winreg module allows you to work with the windows registry

def ListRegistryKeys(path):
   # if its empty do nothing
   if not path: return

   key=_winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, path)

   i=0
   name = []

   try:
   while 1:
   name.append(path + "\\" + _winreg.EnumKey(key, i))
   print name[-1]
   i += 1
   except WindowsError:
   pass

   _winreg.CloseKey( key)


   for item in name:
   ListRegistryKeys(item)

   return name


def parseRegistry():
   guidlist = ListRegistryKeys("CLSID")

   for item in guidlist:
   print "parseRegistry: ", item

def main():
   parseRegistry()

if __name__=="__main__":
   main()
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] IIS and Virtual directories

2006-11-22 Thread Todd Dahl

I have been trying to figure out how to create an IIS Virtual Directory
through Python but can't find anything that works. I have done it in the
past with Perl with the script below but can't seem to figure out how to do
it in Python. I was wondering if someone could point me in the right
direction.

Thank you,
-Todd

P.S."Hope everyone who reads this has a nice Thanksgiving!"

=



##
# Description: Use ADSI to create IIS virtual#
##

use Win32::OLE;

my $server = "localhost";
my $VirtualDir = "AIRAdmin";

mkdir("nhvrweb",0777);


eval{

#Create WWW directory

#Check if the directory already exsist
if (! ($www =
Win32::OLE->GetObject("IIS://$server/W3svc/1/Root/$VirtualDir")))
{
 $www = Win32::OLE->GetObject("IIS://$server/W3svc/1");
 $vRoot = $www->GetObject("IIsWebVirtualDir", "Root");
 $vDir = $vRoot->Create("IIsWebVirtualDir",$VirtualDir);
 $vDir->{AccessScript} = 1;
 $vDir->{Path} = "C:\\nhvr\\$VirtualDir";
 $vDir->SetInfo();
 $vDir->AppCreate(1);
}

};
#In case of error
print Win32::OLE->LastError()."\n"if(Win32::OLE->LastError());
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor